OLD | NEW |
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 #include "chrome/browser/ui/gtk/reload_button_gtk.h" | 5 #include "chrome/browser/ui/gtk/reload_button_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 // Start a timer - while this timer is running, the reload button cannot be | 186 // Start a timer - while this timer is running, the reload button cannot be |
187 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP | 187 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP |
188 // here as the browser will do that when it actually starts loading (which | 188 // here as the browser will do that when it actually starts loading (which |
189 // may happen synchronously, thus the need to do this before telling the | 189 // may happen synchronously, thus the need to do this before telling the |
190 // browser to execute the reload command). | 190 // browser to execute the reload command). |
191 double_click_timer_.Start(FROM_HERE, double_click_timer_delay_, this, | 191 double_click_timer_.Start(FROM_HERE, double_click_timer_delay_, this, |
192 &ReloadButtonGtk::OnDoubleClickTimer); | 192 &ReloadButtonGtk::OnDoubleClickTimer); |
193 | 193 |
194 if (browser_) | 194 if (browser_) |
195 browser_->ExecuteCommandWithDisposition(command, disposition); | 195 chrome::ExecuteCommandWithDisposition(browser_, command, disposition); |
196 ++testing_reload_count_; | 196 ++testing_reload_count_; |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 gboolean ReloadButtonGtk::OnExpose(GtkWidget* widget, | 200 gboolean ReloadButtonGtk::OnExpose(GtkWidget* widget, |
201 GdkEventExpose* e) { | 201 GdkEventExpose* e) { |
202 TRACE_EVENT0("ui::gtk", "ReloadButtonGtk::OnExpose"); | 202 TRACE_EVENT0("ui::gtk", "ReloadButtonGtk::OnExpose"); |
203 if (theme_service_ && theme_service_->UsingNativeTheme()) | 203 if (theme_service_ && theme_service_->UsingNativeTheme()) |
204 return FALSE; | 204 return FALSE; |
205 return ((visible_mode_ == MODE_RELOAD) ? reload_ : stop_).OnExpose( | 205 return ((visible_mode_ == MODE_RELOAD) ? reload_ : stop_).OnExpose( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk); | 276 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk); |
277 } | 277 } |
278 | 278 |
279 void ReloadButtonGtk::OnDoubleClickTimer() { | 279 void ReloadButtonGtk::OnDoubleClickTimer() { |
280 ChangeMode(intended_mode_, false); | 280 ChangeMode(intended_mode_, false); |
281 } | 281 } |
282 | 282 |
283 void ReloadButtonGtk::OnStopToReloadTimer() { | 283 void ReloadButtonGtk::OnStopToReloadTimer() { |
284 ChangeMode(intended_mode_, true); | 284 ChangeMode(intended_mode_, true); |
285 } | 285 } |
OLD | NEW |