| OLD | NEW |
| 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/timer.h" | 13 #include "base/timer.h" |
| 14 #include "chrome/browser/ui/gtk/custom_button.h" | 14 #include "chrome/browser/ui/gtk/custom_button.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/base/gtk/gtk_signal.h" | 17 #include "ui/base/gtk/gtk_signal.h" |
| 18 #include "ui/base/gtk/owned_widget_gtk.h" | 18 #include "ui/base/gtk/owned_widget_gtk.h" |
| 19 | 19 |
| 20 class Browser; | 20 class Browser; |
| 21 class GtkThemeService; | 21 class ThemeServiceGtk; |
| 22 class LocationBarViewGtk; | 22 class LocationBarViewGtk; |
| 23 | 23 |
| 24 class ReloadButtonGtk : public content::NotificationObserver { | 24 class ReloadButtonGtk : public content::NotificationObserver { |
| 25 public: | 25 public: |
| 26 enum Mode { MODE_RELOAD = 0, MODE_STOP }; | 26 enum Mode { MODE_RELOAD = 0, MODE_STOP }; |
| 27 | 27 |
| 28 ReloadButtonGtk(LocationBarViewGtk* location_bar, Browser* browser); | 28 ReloadButtonGtk(LocationBarViewGtk* location_bar, Browser* browser); |
| 29 virtual ~ReloadButtonGtk(); | 29 virtual ~ReloadButtonGtk(); |
| 30 | 30 |
| 31 GtkWidget* widget() const { return widget_.get(); } | 31 GtkWidget* widget() const { return widget_.get(); } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // The mode we should be in assuming no timers are running. | 71 // The mode we should be in assuming no timers are running. |
| 72 Mode intended_mode_; | 72 Mode intended_mode_; |
| 73 | 73 |
| 74 // The currently-visible mode - this may differ from the intended mode. | 74 // The currently-visible mode - this may differ from the intended mode. |
| 75 Mode visible_mode_; | 75 Mode visible_mode_; |
| 76 | 76 |
| 77 // Used to listen for theme change notifications. | 77 // Used to listen for theme change notifications. |
| 78 content::NotificationRegistrar registrar_; | 78 content::NotificationRegistrar registrar_; |
| 79 | 79 |
| 80 GtkThemeService* theme_service_; | 80 ThemeServiceGtk* theme_service_; |
| 81 | 81 |
| 82 CustomDrawButtonBase reload_; | 82 CustomDrawButtonBase reload_; |
| 83 CustomDrawButtonBase stop_; | 83 CustomDrawButtonBase stop_; |
| 84 CustomDrawHoverController hover_controller_; | 84 CustomDrawHoverController hover_controller_; |
| 85 | 85 |
| 86 ui::OwnedWidgetGtk widget_; | 86 ui::OwnedWidgetGtk widget_; |
| 87 | 87 |
| 88 // The delay times for the timers. These are members so that tests can modify | 88 // The delay times for the timers. These are members so that tests can modify |
| 89 // them. | 89 // them. |
| 90 base::TimeDelta double_click_timer_delay_; | 90 base::TimeDelta double_click_timer_delay_; |
| 91 base::TimeDelta stop_to_reload_timer_delay_; | 91 base::TimeDelta stop_to_reload_timer_delay_; |
| 92 | 92 |
| 93 // TESTING ONLY | 93 // TESTING ONLY |
| 94 // True if we should pretend the button is hovered. | 94 // True if we should pretend the button is hovered. |
| 95 bool testing_mouse_hovered_; | 95 bool testing_mouse_hovered_; |
| 96 // Increments when we would tell the browser to "reload", so | 96 // Increments when we would tell the browser to "reload", so |
| 97 // test code can tell whether we did so (as there may be no |browser_|). | 97 // test code can tell whether we did so (as there may be no |browser_|). |
| 98 int testing_reload_count_; | 98 int testing_reload_count_; |
| 99 | 99 |
| 100 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButtonGtk); | 100 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButtonGtk); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ | 103 #endif // CHROME_BROWSER_UI_GTK_RELOAD_BUTTON_GTK_H_ |
| OLD | NEW |