Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1463)

Side by Side Diff: chrome/browser/safe_browsing/test_safe_browsing_blocking_page_quiet.cc

Issue 2894243002: Add quiet safe browsing interstitials to chrome://interstitials for in browser testing (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/safe_browsing/test_safe_browsing_blocking_page_quiet.h"
6
7 #include "components/grit/components_resources.h"
8 #include "components/security_interstitials/content/security_interstitial_contro ller_client.h"
9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/base/webui/jstemplate_builder.h"
11 #include "ui/base/webui/web_ui_util.h"
12
13 namespace security_interstitials {
14 TestSafeBrowsingBlockingPageQuiet::~TestSafeBrowsingBlockingPageQuiet() {}
15
16 TestSafeBrowsingBlockingPageQuiet::TestSafeBrowsingBlockingPageQuiet(
17 safe_browsing::BaseUIManager* ui_manager,
18 content::WebContents* web_contents,
19 const GURL& main_frame_url,
20 const UnsafeResourceList& unsafe_resources,
21 const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options,
22 bool is_giant_webview)
23 : BaseBlockingPage(
24 ui_manager,
25 web_contents,
26 main_frame_url,
27 unsafe_resources,
28 CreateControllerClient(web_contents, unsafe_resources, ui_manager),
29 display_options),
30 sb_error_ui_(unsafe_resources[0].url,
31 main_frame_url,
32 GetInterstitialReason(unsafe_resources),
33 display_options,
34 ui_manager->app_locale(),
35 base::Time::NowFromSystemTime(),
36 controller(),
37 is_giant_webview) {}
38
39 // static
40 TestSafeBrowsingBlockingPageQuiet*
41 TestSafeBrowsingBlockingPageQuiet::CreateBlockingPage(
42 safe_browsing::BaseUIManager* ui_manager,
43 content::WebContents* web_contents,
44 const GURL& main_frame_url,
45 const UnsafeResource& unsafe_resource,
46 bool is_giant_webview) {
47 const UnsafeResourceList resources{unsafe_resource};
48
49 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options(
50 false, // is_main_frame_load_blocked
51 false, // is_extended_reporting_opt_in_allowed
52 false, // is_off_the_record
53 false, // is_extended_reporting_enabled
54 false, // is_scout_reporting_enabled
55 false, // is_proceed_anyway_disabled
56 false); // is_resource_cancellable
57
58 return new TestSafeBrowsingBlockingPageQuiet(
59 ui_manager, web_contents, main_frame_url, resources, display_options,
60 is_giant_webview);
61 // blocking_page->Show();
felt 2017/05/20 00:00:06 commented out?
edwardjung 2017/05/22 11:29:51 Removed.
62 }
63
64 std::string TestSafeBrowsingBlockingPageQuiet::GetHTML() {
65 base::DictionaryValue load_time_data;
66 sb_error_ui_.PopulateStringsForHtml(&load_time_data);
67 webui::SetLoadTimeDataDefaults(controller()->GetApplicationLocale(),
68 &load_time_data);
69 std::string html =
70 ResourceBundle::GetSharedInstance()
71 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_QUIET_HTML)
72 .as_string();
73 webui::AppendWebUiCssTextDefaults(&html);
74 html = webui::GetI18nTemplateHtml(html, &load_time_data);
75 return html;
76 }
77
78 } // namespace security_interstitials
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698