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

Unified Diff: content/shell/browser/shell.cc

Issue 161113002: Fix pushState causing stop/reload button and favicon to flicker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/browser/shell.h ('k') | content/test/data/push_state.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell.cc
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 65491237ab7dea5c96a6478c50c9bb432274e85f..b19ad1f313721f2fdc7c02259a96348ef1ca4110 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -205,13 +205,14 @@ void Shell::Stop() {
web_contents_->GetView()->Focus();
}
-void Shell::UpdateNavigationControls() {
+void Shell::UpdateNavigationControls(bool to_different_document) {
int current_index = web_contents_->GetController().GetCurrentEntryIndex();
int max_index = web_contents_->GetController().GetEntryCount() - 1;
PlatformEnableUIControl(BACK_BUTTON, current_index > 0);
PlatformEnableUIControl(FORWARD_BUTTON, current_index < max_index);
- PlatformEnableUIControl(STOP_BUTTON, web_contents_->IsLoading());
+ PlatformEnableUIControl(STOP_BUTTON,
+ to_different_document && web_contents_->IsLoading());
}
void Shell::ShowDevTools() {
@@ -266,8 +267,9 @@ WebContents* Shell::OpenURLFromTab(WebContents* source,
return source;
}
-void Shell::LoadingStateChanged(WebContents* source) {
- UpdateNavigationControls();
+void Shell::LoadingStateChanged(WebContents* source,
+ bool to_different_document) {
+ UpdateNavigationControls(to_different_document);
PlatformSetIsLoading(source->IsLoading());
}
« no previous file with comments | « content/shell/browser/shell.h ('k') | content/test/data/push_state.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698