summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 16:06:09 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 16:06:09 +0000
commite3b10d1ee147e27bac357b41ce7cf3b751e4a33e (patch)
treefcd5511c60fcc6eca77e30e50cd45eff11d6a9ea /content/shell
parent28dfb8c039f27b27e2dd3d64b0d1cf351a15c794 (diff)
downloadchromium_src-e3b10d1ee147e27bac357b41ce7cf3b751e4a33e.zip
chromium_src-e3b10d1ee147e27bac357b41ce7cf3b751e4a33e.tar.gz
chromium_src-e3b10d1ee147e27bac357b41ce7cf3b751e4a33e.tar.bz2
Fix pushState causing stop/reload button and favicon to flicker.
BUG=50298 Review URL: https://codereview.chromium.org/161113002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/browser/shell.cc10
-rw-r--r--content/shell/browser/shell.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 6549123..b19ad1f 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());
}
diff --git a/content/shell/browser/shell.h b/content/shell/browser/shell.h
index 5248199..1156f21 100644
--- a/content/shell/browser/shell.h
+++ b/content/shell/browser/shell.h
@@ -65,7 +65,7 @@ class Shell : public WebContentsDelegate,
void GoBackOrForward(int offset);
void Reload();
void Stop();
- void UpdateNavigationControls();
+ void UpdateNavigationControls(bool to_different_document);
void Close();
void ShowDevTools();
void ShowDevToolsForElementAt(int x, int y);
@@ -119,7 +119,8 @@ class Shell : public WebContentsDelegate,
const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) OVERRIDE;
- virtual void LoadingStateChanged(WebContents* source) OVERRIDE;
+ virtual void LoadingStateChanged(WebContents* source,
+ bool to_different_document) OVERRIDE;
#if defined(OS_ANDROID)
virtual void LoadProgressChanged(WebContents* source,
double progress) OVERRIDE;