diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_commands.cc | 2 | ||||
-rw-r--r-- | chrome/browser/navigation_controller.cc | 8 | ||||
-rw-r--r-- | chrome/browser/navigation_controller.h | 10 | ||||
-rw-r--r-- | chrome/browser/navigation_controller_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/render_view_context_menu_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/repost_form_warning_dialog.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ssl_policy.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 2 |
8 files changed, 13 insertions, 19 deletions
diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc index 6d7a122..f359c14 100644 --- a/chrome/browser/browser_commands.cc +++ b/chrome/browser/browser_commands.cc @@ -771,7 +771,7 @@ void Browser::Reload() { if (current_tab) { // As this is caused by a user action, give the focus to the page. current_tab->Focus(); - current_tab->controller()->Reload(); + current_tab->controller()->Reload(true); } } diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc index ca0aac8..77d5269 100644 --- a/chrome/browser/navigation_controller.cc +++ b/chrome/browser/navigation_controller.cc @@ -223,14 +223,14 @@ TabContents* NavigationController::GetTabContents(TabContentsType t) { return tab_contents_map_[t]; } -void NavigationController::Reload() { +void NavigationController::Reload(bool check_for_repost) { // Reloading a transient entry does nothing. if (transient_entry_index_ != -1) return; DiscardNonCommittedEntriesInternal(); int current_index = GetCurrentEntryIndex(); - if (check_for_repost_ && current_index != -1 && + if (check_for_repost_ && check_for_repost && current_index != -1 && GetEntryAtIndex(current_index)->has_post_data() && active_contents_->AsWebContents() && !active_contents_->AsWebContents()->showing_repost_interstitial()) { @@ -387,10 +387,6 @@ void NavigationController::GoToOffset(int offset) { GoToIndex(index); } -void NavigationController::ReloadDontCheckForRepost() { - Reload(); -} - void NavigationController::RemoveEntryAtIndex(int index, const GURL& default_url) { int size = static_cast<int>(entries_.size()); diff --git a/chrome/browser/navigation_controller.h b/chrome/browser/navigation_controller.h index 522c8b1..5b5408f 100644 --- a/chrome/browser/navigation_controller.h +++ b/chrome/browser/navigation_controller.h @@ -283,12 +283,10 @@ class NavigationController { // the offset is out of bounds. void GoToOffset(int offset); - // Reloads the current entry. The user will be prompted if the URL has POST - // data and the active WebContents isn't showing the POST interstitial page. - void Reload(); - - // Same as Reload, but doesn't check if current entry has POST data. - void ReloadDontCheckForRepost(); + // Reloads the current entry. If |check_for_repost| is true and the current + // entry has POST data the user is prompted to see if they really want to + // reload the page. In nearly all cases pass in true. + void Reload(bool check_for_repost); // Removing of entries ------------------------------------------------------- diff --git a/chrome/browser/navigation_controller_unittest.cc b/chrome/browser/navigation_controller_unittest.cc index 8f3c865..64dae5e 100644 --- a/chrome/browser/navigation_controller_unittest.cc +++ b/chrome/browser/navigation_controller_unittest.cc @@ -483,7 +483,7 @@ TEST_F(NavigationControllerTest, Reload) { contents->CompleteNavigationAsRenderer(0, url1); EXPECT_TRUE(notifications.Check1AndReset(NOTIFY_NAV_ENTRY_COMMITTED)); - contents->controller()->Reload(); + contents->controller()->Reload(true); EXPECT_EQ(0, notifications.size()); // The reload is pending. @@ -520,7 +520,7 @@ TEST_F(NavigationControllerTest, Reload_GeneratesNewPage) { contents->CompleteNavigationAsRenderer(0, url1); EXPECT_TRUE(notifications.Check1AndReset(NOTIFY_NAV_ENTRY_COMMITTED)); - contents->controller()->Reload(); + contents->controller()->Reload(true); EXPECT_EQ(0, notifications.size()); contents->CompleteNavigationAsRenderer(1, url2); diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc index c8dcaf3..f639b19 100644 --- a/chrome/browser/render_view_context_menu_controller.cc +++ b/chrome/browser/render_view_context_menu_controller.cc @@ -276,7 +276,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { break; case IDS_CONTENT_CONTEXT_RELOAD: - source_web_contents_->controller()->Reload(); + source_web_contents_->controller()->Reload(true); break; case IDS_CONTENT_CONTEXT_PRINT: diff --git a/chrome/browser/repost_form_warning_dialog.cc b/chrome/browser/repost_form_warning_dialog.cc index e3c6b97..5ae4d0e 100644 --- a/chrome/browser/repost_form_warning_dialog.cc +++ b/chrome/browser/repost_form_warning_dialog.cc @@ -55,7 +55,7 @@ bool RepostFormWarningDialog::Cancel() { bool RepostFormWarningDialog::Accept() { if (navigation_controller_) - navigation_controller_->ReloadDontCheckForRepost(); + navigation_controller_->Reload(false); return true; } diff --git a/chrome/browser/ssl_policy.cc b/chrome/browser/ssl_policy.cc index 0fbb9eb..62dbf408 100644 --- a/chrome/browser/ssl_policy.cc +++ b/chrome/browser/ssl_policy.cc @@ -63,7 +63,7 @@ void ShowUnsafeContentTask::Run() { // Reload the page. DCHECK(error_handler_->GetTabContents()->type() == TAB_CONTENTS_WEB); WebContents* tab = error_handler_->GetTabContents()->AsWebContents(); - tab->controller()->Reload(); + tab->controller()->Reload(true); } static void ShowErrorPage(SSLPolicy* policy, SSLManager::CertError* error) { diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 40d1911..f8f8aa1 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -451,7 +451,7 @@ void TabStripModel::ExecuteContextMenuCommand( break; case CommandReload: UserMetrics::RecordAction(L"TabContextMenu_Reload", profile_); - GetContentsAt(context_index)->controller()->Reload(); + GetContentsAt(context_index)->controller()->Reload(true); break; case CommandDuplicate: if (delegate_) { |