| Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
| diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
| index 674d38463ea368f8378e4c762ba6e625d84704d1..dd641b5459b71fea4263b28df3e424e9ecde91a1 100644
|
| --- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
| +++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
| @@ -65,8 +65,8 @@ scoped_refptr<net::X509Certificate> CreateFakeCert() {
|
| // not used in displaying any real interstitials.
|
| class InterstitialHTMLSource : public content::URLDataSource {
|
| public:
|
| - explicit InterstitialHTMLSource(content::WebContents* web_contents);
|
| - ~InterstitialHTMLSource() override;
|
| + InterstitialHTMLSource() {}
|
| + ~InterstitialHTMLSource() override {}
|
|
|
| // content::URLDataSource:
|
| std::string GetMimeType(const std::string& mime_type) const override;
|
| @@ -80,7 +80,6 @@ class InterstitialHTMLSource : public content::URLDataSource {
|
| const content::URLDataSource::GotDataCallback& callback) override;
|
|
|
| private:
|
| - content::WebContents* web_contents_;
|
| DISALLOW_COPY_AND_ASSIGN(InterstitialHTMLSource);
|
| };
|
|
|
| @@ -308,10 +307,8 @@ CaptivePortalBlockingPage* CreateCaptivePortalBlockingPage(
|
|
|
| InterstitialUI::InterstitialUI(content::WebUI* web_ui)
|
| : WebUIController(web_ui) {
|
| - std::unique_ptr<InterstitialHTMLSource> html_source(
|
| - new InterstitialHTMLSource(web_ui->GetWebContents()));
|
| Profile* profile = Profile::FromWebUI(web_ui);
|
| - content::URLDataSource::Add(profile, html_source.release());
|
| + content::URLDataSource::Add(profile, new InterstitialHTMLSource());
|
| }
|
|
|
| InterstitialUI::~InterstitialUI() {
|
| @@ -319,14 +316,6 @@ InterstitialUI::~InterstitialUI() {
|
|
|
| // InterstitialHTMLSource
|
|
|
| -InterstitialHTMLSource::InterstitialHTMLSource(
|
| - content::WebContents* web_contents)
|
| - : web_contents_(web_contents) {
|
| -}
|
| -
|
| -InterstitialHTMLSource::~InterstitialHTMLSource() {
|
| -}
|
| -
|
| std::string InterstitialHTMLSource::GetMimeType(
|
| const std::string& mime_type) const {
|
| return "text/html";
|
| @@ -353,20 +342,21 @@ void InterstitialHTMLSource::StartDataRequest(
|
| const std::string& path,
|
| const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
|
| const content::URLDataSource::GotDataCallback& callback) {
|
| + content::WebContents* web_contents = wc_getter.Run();
|
| std::unique_ptr<content::InterstitialPageDelegate> interstitial_delegate;
|
| if (base::StartsWith(path, "ssl", base::CompareCase::SENSITIVE)) {
|
| - interstitial_delegate.reset(CreateSSLBlockingPage(web_contents_));
|
| + interstitial_delegate.reset(CreateSSLBlockingPage(web_contents));
|
| } else if (base::StartsWith(path, "safebrowsing",
|
| base::CompareCase::SENSITIVE)) {
|
| - interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents_));
|
| + interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents));
|
| } else if (base::StartsWith(path, "clock", base::CompareCase::SENSITIVE)) {
|
| - interstitial_delegate.reset(CreateBadClockBlockingPage(web_contents_));
|
| + interstitial_delegate.reset(CreateBadClockBlockingPage(web_contents));
|
| }
|
| #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
|
| else if (base::StartsWith(path, "captiveportal",
|
| base::CompareCase::SENSITIVE))
|
| {
|
| - interstitial_delegate.reset(CreateCaptivePortalBlockingPage(web_contents_));
|
| + interstitial_delegate.reset(CreateCaptivePortalBlockingPage(web_contents));
|
| }
|
| #endif
|
| std::string html;
|
|
|