OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
6 | 6 |
7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 malware_details_ = MalwareDetails::NewMalwareDetails( | 235 malware_details_ = MalwareDetails::NewMalwareDetails( |
236 ui_manager_, web_contents, unsafe_resources[0]); | 236 ui_manager_, web_contents, unsafe_resources[0]); |
237 } | 237 } |
238 | 238 |
239 interstitial_page_ = InterstitialPage::Create( | 239 interstitial_page_ = InterstitialPage::Create( |
240 web_contents, IsMainPageLoadBlocked(unsafe_resources), url_, this); | 240 web_contents, IsMainPageLoadBlocked(unsafe_resources), url_, this); |
241 } | 241 } |
242 | 242 |
243 bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() { | 243 bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() { |
244 return (!web_contents_->GetBrowserContext()->IsOffTheRecord() && | 244 return (!web_contents_->GetBrowserContext()->IsOffTheRecord() && |
245 web_contents_->GetURL().SchemeIs(chrome::kHttpScheme)); | 245 web_contents_->GetURL().SchemeIs(content::kHttpScheme)); |
246 } | 246 } |
247 | 247 |
248 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { | 248 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { |
249 } | 249 } |
250 | 250 |
251 void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { | 251 void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { |
252 std::string command(cmd); // Make a local copy so we can modify it. | 252 std::string command(cmd); // Make a local copy so we can modify it. |
253 // The Jasonified response has quotes, remove them. | 253 // The Jasonified response has quotes, remove them. |
254 if (command.length() > 1 && command[0] == '"') { | 254 if (command.length() > 1 && command[0] == '"') { |
255 command = command.substr(1, command.length() - 2); | 255 command = command.substr(1, command.length() - 2); |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 strings->SetString("details", std::string()); | 1132 strings->SetString("details", std::string()); |
1133 strings->SetString("confirm_text", std::string()); | 1133 strings->SetString("confirm_text", std::string()); |
1134 strings->SetString(kBoxChecked, std::string()); | 1134 strings->SetString(kBoxChecked, std::string()); |
1135 strings->SetString( | 1135 strings->SetString( |
1136 "report_error", | 1136 "report_error", |
1137 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); | 1137 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); |
1138 strings->SetBoolean(kDisplayCheckBox, false); | 1138 strings->SetBoolean(kDisplayCheckBox, false); |
1139 strings->SetString("learnMore", | 1139 strings->SetString("learnMore", |
1140 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); | 1140 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); |
1141 } | 1141 } |
OLD | NEW |