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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 malware_details_ = MalwareDetails::NewMalwareDetails( | 258 malware_details_ = MalwareDetails::NewMalwareDetails( |
259 ui_manager_, web_contents, unsafe_resources[0]); | 259 ui_manager_, web_contents, unsafe_resources[0]); |
260 } | 260 } |
261 | 261 |
262 interstitial_page_ = InterstitialPage::Create( | 262 interstitial_page_ = InterstitialPage::Create( |
263 web_contents, IsMainPageLoadBlocked(unsafe_resources), url_, this); | 263 web_contents, IsMainPageLoadBlocked(unsafe_resources), url_, this); |
264 } | 264 } |
265 | 265 |
266 bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() { | 266 bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() { |
267 return (!web_contents_->GetBrowserContext()->IsOffTheRecord() && | 267 return (!web_contents_->GetBrowserContext()->IsOffTheRecord() && |
268 web_contents_->GetURL().SchemeIs(content::kHttpScheme)); | 268 web_contents_->GetURL().SchemeIs(url::kHttpScheme)); |
269 } | 269 } |
270 | 270 |
271 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { | 271 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { |
272 } | 272 } |
273 | 273 |
274 void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { | 274 void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { |
275 std::string command(cmd); // Make a local copy so we can modify it. | 275 std::string command(cmd); // Make a local copy so we can modify it. |
276 // The Jasonified response has quotes, remove them. | 276 // The Jasonified response has quotes, remove them. |
277 if (command.length() > 1 && command[0] == '"') { | 277 if (command.length() > 1 && command[0] == '"') { |
278 command = command.substr(1, command.length() - 2); | 278 command = command.substr(1, command.length() - 2); |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 strings->SetString("details", std::string()); | 1185 strings->SetString("details", std::string()); |
1186 strings->SetString("confirm_text", std::string()); | 1186 strings->SetString("confirm_text", std::string()); |
1187 strings->SetString(kBoxChecked, std::string()); | 1187 strings->SetString(kBoxChecked, std::string()); |
1188 strings->SetString( | 1188 strings->SetString( |
1189 "report_error", | 1189 "report_error", |
1190 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); | 1190 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); |
1191 strings->SetBoolean(kDisplayCheckBox, false); | 1191 strings->SetBoolean(kDisplayCheckBox, false); |
1192 strings->SetString("learnMore", | 1192 strings->SetString("learnMore", |
1193 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); | 1193 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); |
1194 } | 1194 } |
OLD | NEW |