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 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ |
7 | 7 |
8 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 8 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
9 | 9 |
10 class PanelBrowserWindowGtk; | 10 class PanelBrowserWindowGtk; |
11 | 11 |
12 class PanelBrowserTitlebarGtk : public BrowserTitlebar { | 12 class PanelBrowserTitlebarGtk : public BrowserTitlebar { |
13 public: | 13 public: |
14 PanelBrowserTitlebarGtk(PanelBrowserWindowGtk* browser_window, | 14 PanelBrowserTitlebarGtk(PanelBrowserWindowGtk* browser_window, |
15 GtkWindow* window); | 15 GtkWindow* window); |
16 virtual ~PanelBrowserTitlebarGtk(); | 16 virtual ~PanelBrowserTitlebarGtk(); |
17 | 17 |
| 18 // Overridden from BrowserTitlebar: |
| 19 virtual void Init() OVERRIDE; |
| 20 |
18 void UpdateMinimizeRestoreButtonVisibility(); | 21 void UpdateMinimizeRestoreButtonVisibility(); |
19 | 22 |
20 protected: | 23 protected: |
21 // Overridden from BrowserTitlebar: | 24 // Overridden from BrowserTitlebar: |
22 virtual bool BuildButton(const std::string& button_token, | 25 virtual bool BuildButton(const std::string& button_token, |
23 bool left_side) OVERRIDE; | 26 bool left_side) OVERRIDE; |
24 virtual void GetButtonResources(const std::string& button_name, | 27 virtual void GetButtonResources(const std::string& button_name, |
25 int* normal_image_id, | 28 int* normal_image_id, |
26 int* pressed_image_id, | 29 int* pressed_image_id, |
27 int* hover_image_id, | 30 int* hover_image_id, |
28 int* tooltip_id) const OVERRIDE; | 31 int* tooltip_id) const OVERRIDE; |
29 virtual int GetButtonOuterPadding() const OVERRIDE; | 32 virtual int GetButtonOuterPadding() const OVERRIDE; |
30 virtual int GetButtonSpacing() const OVERRIDE; | 33 virtual int GetButtonSpacing() const OVERRIDE; |
31 virtual void HandleButtonClick(GtkWidget* button) OVERRIDE; | 34 virtual void HandleButtonClick(GtkWidget* button) OVERRIDE; |
32 virtual void ShowFaviconMenu(GdkEventButton* event) OVERRIDE; | 35 virtual void ShowFaviconMenu(GdkEventButton* event) OVERRIDE; |
33 | 36 |
34 private: | 37 private: |
35 friend class NativePanelTestingGtk; | 38 friend class NativePanelTestingGtk; |
36 | 39 |
37 CustomDrawButton* unminimize_button() const { | 40 CustomDrawButton* unminimize_button() const { |
38 return unminimize_button_.get(); | 41 return unminimize_button_.get(); |
39 } | 42 } |
40 | 43 |
| 44 CHROMEGTK_CALLBACK_1(PanelBrowserTitlebarGtk, gboolean, |
| 45 OnMinimizeButtonReleaseEvent, GdkEventButton*); |
| 46 CHROMEGTK_CALLBACK_1(PanelBrowserTitlebarGtk, gboolean, |
| 47 OnUnminimizeButtonReleaseEvent, GdkEventButton*); |
| 48 |
41 PanelBrowserWindowGtk* browser_window_; | 49 PanelBrowserWindowGtk* browser_window_; |
42 | 50 |
43 // All other buttons, including close and minimize buttons, are defined in | 51 // All other buttons, including close and minimize buttons, are defined in |
44 // the base class BrowserTitlebar. This is indeed our restore button. But | 52 // the base class BrowserTitlebar. This is indeed our restore button. But |
45 // we name it differently to avoid the confusion with restore_button defined | 53 // we name it differently to avoid the confusion with restore_button defined |
46 // in the base class and used for unmaximize purpose. | 54 // in the base class and used for unmaximize purpose. |
47 scoped_ptr<CustomDrawButton> unminimize_button_; | 55 scoped_ptr<CustomDrawButton> unminimize_button_; |
48 | 56 |
49 DISALLOW_COPY_AND_ASSIGN(PanelBrowserTitlebarGtk); | 57 DISALLOW_COPY_AND_ASSIGN(PanelBrowserTitlebarGtk); |
50 }; | 58 }; |
51 | 59 |
52 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ | 60 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_ |
OLD | NEW |