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

Unified Diff: chrome/browser/gtk/reload_button_gtk.cc

Issue 3198005: Disable the stop button when the user is hovering it and the page finishes lo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/browser/cocoa/reload_button_unittest.mm ('k') | chrome/browser/views/reload_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/reload_button_gtk.cc
===================================================================
--- chrome/browser/gtk/reload_button_gtk.cc (revision 56793)
+++ chrome/browser/gtk/reload_button_gtk.cc (working copy)
@@ -95,7 +95,7 @@
}
void ReloadButtonGtk::OnButtonTimer() {
- ChangeMode(intended_mode_, true);
+ ChangeMode(intended_mode_, false);
}
void ReloadButtonGtk::OnClicked(GtkWidget* sender) {
@@ -130,9 +130,6 @@
location_bar_->Revert();
}
- if (browser_)
- browser_->ExecuteCommandWithDisposition(command, disposition);
-
// Figure out the system double-click time.
if (button_delay_ == 0) {
GtkSettings* settings = gtk_settings_get_default();
@@ -142,11 +139,15 @@
// Start a timer - while this timer is running, the reload button cannot be
// changed to a stop button. We do not set |intended_mode_| to MODE_STOP
- // here as we want to wait for the browser to tell us that it has started
- // loading (and this may occur only after some delay).
+ // here as the browser will do that when it actually starts loading (which
+ // may happen synchronously, thus the need to do this before telling the
+ // browser to execute the reload command).
timer_.Stop();
timer_.Start(base::TimeDelta::FromMilliseconds(button_delay_), this,
&ReloadButtonGtk::OnButtonTimer);
+
+ if (browser_)
+ browser_->ExecuteCommandWithDisposition(command, disposition);
}
}
« no previous file with comments | « chrome/browser/cocoa/reload_button_unittest.mm ('k') | chrome/browser/views/reload_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698