1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_RENDERER_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
#define COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_RENDERER_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
#include "components/security_interstitials/core/controller_client.h"
#include "content/public/renderer/render_frame_observer.h"
#include "gin/wrappable.h"
namespace content {
class RenderFrame;
}
namespace security_interstitials {
// This class makes various helper functions available to interstitials
// when committed interstitials are on. It is bound to the JavaScript
// window.certificateErrorPageController object.
class SecurityInterstitialPageController
: public gin::Wrappable<SecurityInterstitialPageController>,
public content::RenderFrameObserver {
public:
static gin::WrapperInfo kWrapperInfo;
SecurityInterstitialPageController(
const SecurityInterstitialPageController&) = delete;
SecurityInterstitialPageController& operator=(
const SecurityInterstitialPageController&) = delete;
// Creates an instance of SecurityInterstitialPageController which will invoke
// SendCommand() in response to user actions taken on the interstitial page.
static void Install(content::RenderFrame* render_frame);
private:
explicit SecurityInterstitialPageController(
content::RenderFrame* render_frame);
~SecurityInterstitialPageController() override;
void DontProceed();
void Proceed();
void ShowMoreSection();
void OpenHelpCenter();
void OpenDiagnostic();
void Reload();
void OpenDateSettings();
void OpenLogin();
void DoReport();
void DontReport();
void OpenReportingPrivacy();
void OpenWhitepaper();
void ReportPhishingError();
void OpenEnhancedProtectionSettings();
#if BUILDFLAG(IS_ANDROID)
void OpenAdvancedProtectionSettings();
#endif // BUILDFLAG(IS_ANDROID)
void SendCommand(security_interstitials::SecurityInterstitialCommand command);
// gin::WrappableBase
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
// RenderFrameObserver:
void OnDestruct() override;
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
// True if |this| forwards interstitial commands to the browser. This will be
// set to false after any navigation.
bool active_ = true;
};
} // namespace security_interstitials
#endif // COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_RENDERER_SECURITY_INTERSTITIAL_PAGE_CONTROLLER_H_
|