| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_BACK_FORWARD_BUTTON_GTK_ | 5 #ifndef CHROME_BROWSER_GTK_BACK_FORWARD_BUTTON_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_BACK_FORWARD_BUTTON_GTK_ | 6 #define CHROME_BROWSER_GTK_BACK_FORWARD_BUTTON_GTK_H_ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "chrome/browser/gtk/custom_button.h" | 10 #include "chrome/browser/gtk/custom_button.h" |
| 11 | 11 |
| 12 class BackForwardMenuModelGtk; | 12 class BackForwardMenuModelGtk; |
| 13 class Browser; | 13 class Browser; |
| 14 class MenuGtk; | 14 class MenuGtk; |
| 15 | 15 |
| 16 typedef struct _GtkWidget GtkWidget; | 16 typedef struct _GtkWidget GtkWidget; |
| 17 | 17 |
| 18 // When clicked, these buttons will navigate forward or backward. When | 18 // When clicked, these buttons will navigate forward or backward. When |
| 19 // pressed and held, they show a dropdown menu of recent web sites. | 19 // pressed and held, they show a dropdown menu of recent web sites. |
| 20 class BackForwardButtonGtk { | 20 class BackForwardButtonGtk { |
| 21 public: | 21 public: |
| 22 BackForwardButtonGtk(Browser* browser, bool is_forward); | 22 BackForwardButtonGtk(Browser* browser, bool is_forward); |
| 23 virtual ~BackForwardButtonGtk(); | 23 virtual ~BackForwardButtonGtk(); |
| 24 | 24 |
| 25 // The dropdown menu is no longer showing. | 25 // The dropdown menu is no longer showing. |
| 26 void StoppedShowingMenu(); | 26 void StoppedShowingMenu(); |
| 27 | 27 |
| 28 GtkWidget* widget() { return button_->widget(); } | 28 GtkWidget* widget() { return button_->widget(); } |
| 29 | 29 |
| 30 // Advises our CustomDrawButtons on how to render. |
| 31 void SetUseSystemTheme(bool use_gtk); |
| 32 |
| 30 private: | 33 private: |
| 31 // Executes the browser command. | 34 // Executes the browser command. |
| 32 static void OnClick(GtkWidget* widget, BackForwardButtonGtk* button); | 35 static void OnClick(GtkWidget* widget, BackForwardButtonGtk* button); |
| 33 | 36 |
| 34 // Starts a timer to show the dropdown menu. | 37 // Starts a timer to show the dropdown menu. |
| 35 static gboolean OnButtonPress(GtkWidget* button, | 38 static gboolean OnButtonPress(GtkWidget* button, |
| 36 GdkEventButton* event, | 39 GdkEventButton* event, |
| 37 BackForwardButtonGtk* toolbar); | 40 BackForwardButtonGtk* toolbar); |
| 38 | 41 |
| 39 static gboolean OnButtonRelease(GtkWidget* button, | 42 static gboolean OnButtonRelease(GtkWidget* button, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 68 scoped_ptr<BackForwardMenuModelGtk> menu_model_; | 71 scoped_ptr<BackForwardMenuModelGtk> menu_model_; |
| 69 | 72 |
| 70 // The y position of the last mouse down event. | 73 // The y position of the last mouse down event. |
| 71 int y_position_of_last_press_; | 74 int y_position_of_last_press_; |
| 72 | 75 |
| 73 ScopedRunnableMethodFactory<BackForwardButtonGtk> show_menu_factory_; | 76 ScopedRunnableMethodFactory<BackForwardButtonGtk> show_menu_factory_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(BackForwardButtonGtk); | 78 DISALLOW_COPY_AND_ASSIGN(BackForwardButtonGtk); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 #endif // CHROME_BROWSER_GTK_BACK_FORWARD_BUTTON_GTK_ | 81 #endif // CHROME_BROWSER_GTK_BACK_FORWARD_BUTTON_GTK_H_ |
| OLD | NEW |