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

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

Issue 19699007: Ensure we don't crash if user navigates back from NTP to Chrome sign-in page before it has fully lo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing indent. Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/signin/signin_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/signin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698