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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 // We don't remove the navigation entry if the tab is being destroyed as this | 475 // We don't remove the navigation entry if the tab is being destroyed as this |
476 // would trigger a navigation that would cause trouble as the render view host | 476 // would trigger a navigation that would cause trouble as the render view host |
477 // for the tab has by then already been destroyed. We also don't delete the | 477 // for the tab has by then already been destroyed. We also don't delete the |
478 // current entry if it has been committed again, which is possible on a page | 478 // current entry if it has been committed again, which is possible on a page |
479 // that had a subresource warning. | 479 // that had a subresource warning. |
480 int last_committed_index = | 480 int last_committed_index = |
481 web_contents_->GetController().GetLastCommittedEntryIndex(); | 481 web_contents_->GetController().GetLastCommittedEntryIndex(); |
482 if (navigation_entry_index_to_remove_ != -1 && | 482 if (navigation_entry_index_to_remove_ != -1 && |
483 navigation_entry_index_to_remove_ != last_committed_index && | 483 navigation_entry_index_to_remove_ != last_committed_index && |
484 !web_contents_->IsBeingDestroyed()) { | 484 !web_contents_->IsBeingDestroyed()) { |
485 web_contents_->GetController().RemoveEntryAtIndex( | 485 CHECK(web_contents_->GetController().RemoveEntryAtIndex( |
486 navigation_entry_index_to_remove_); | 486 navigation_entry_index_to_remove_)); |
487 navigation_entry_index_to_remove_ = -1; | 487 navigation_entry_index_to_remove_ = -1; |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) { | 491 void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) { |
492 // This enum is used for a histogram. Don't reorder, delete, or insert | 492 // This enum is used for a histogram. Don't reorder, delete, or insert |
493 // elements. New elements should be added before MAX_ACTION only. | 493 // elements. New elements should be added before MAX_ACTION only. |
494 enum { | 494 enum { |
495 MALWARE_SHOW = 0, | 495 MALWARE_SHOW = 0, |
496 MALWARE_DONT_PROCEED, | 496 MALWARE_DONT_PROCEED, |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 strings->SetString("details", std::string()); | 1123 strings->SetString("details", std::string()); |
1124 strings->SetString("confirm_text", std::string()); | 1124 strings->SetString("confirm_text", std::string()); |
1125 strings->SetString(kBoxChecked, std::string()); | 1125 strings->SetString(kBoxChecked, std::string()); |
1126 strings->SetString( | 1126 strings->SetString( |
1127 "report_error", | 1127 "report_error", |
1128 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); | 1128 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); |
1129 strings->SetBoolean(kDisplayCheckBox, false); | 1129 strings->SetBoolean(kDisplayCheckBox, false); |
1130 strings->SetString("learnMore", | 1130 strings->SetString("learnMore", |
1131 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); | 1131 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); |
1132 } | 1132 } |
OLD | NEW |