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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_gtk.h

Issue 8595003: Have panels respond to changes in work area on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile linux_view and chromeos. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WINDOW_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 9 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
10 #include "chrome/browser/ui/gtk/menu_gtk.h" 10 #include "chrome/browser/ui/gtk/menu_gtk.h"
11 #include "chrome/browser/ui/panels/native_panel.h" 11 #include "chrome/browser/ui/panels/native_panel.h"
12 #include "ui/base/animation/animation_delegate.h" 12 #include "ui/base/animation/animation_delegate.h"
13 #include "ui/base/x/work_area_watcher_x_observer.h"
13 14
14 class Panel; 15 class Panel;
15 class PanelSettingsMenuModel; 16 class PanelSettingsMenuModel;
16 class NativePanelTestingGtk; 17 class NativePanelTestingGtk;
17 18
18 namespace ui { 19 namespace ui {
19 20
20 class SlideAnimation; 21 class SlideAnimation;
21 22
22 } 23 }
23 24
24 class PanelBrowserWindowGtk : public BrowserWindowGtk, 25 class PanelBrowserWindowGtk : public BrowserWindowGtk,
25 public NativePanel,
26 public MenuGtk::Delegate, 26 public MenuGtk::Delegate,
27 public MessageLoopForUI::Observer, 27 public MessageLoopForUI::Observer,
28 public ui::AnimationDelegate { 28 public NativePanel,
29 public ui::AnimationDelegate,
30 public ui::WorkAreaWatcherXObserver {
29 friend class NativePanelTestingGtk; 31 friend class NativePanelTestingGtk;
30 public: 32 public:
31 PanelBrowserWindowGtk(Browser* browser, Panel* panel, 33 PanelBrowserWindowGtk(Browser* browser, Panel* panel,
32 const gfx::Rect& bounds); 34 const gfx::Rect& bounds);
33 virtual ~PanelBrowserWindowGtk(); 35 virtual ~PanelBrowserWindowGtk();
34 36
35 // BrowserWindowGtk overrides 37 // BrowserWindowGtk override
36 virtual void Init() OVERRIDE; 38 virtual void Init() OVERRIDE;
37 39
38 // BrowserWindow overrides 40 // BrowserWindow overrides
39 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 41 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
40 virtual void ShowSettingsMenu(GtkWidget* widget, 42 virtual void ShowSettingsMenu(GtkWidget* widget,
41 GdkEventButton* event) OVERRIDE; 43 GdkEventButton* event) OVERRIDE;
42 virtual TitleDecoration GetWindowTitle(std::string* title) const OVERRIDE; 44 virtual TitleDecoration GetWindowTitle(std::string* title) const OVERRIDE;
43 45
46 // ui::WorkAreaWatcherXObserver override
47 virtual void WorkAreaChanged() OVERRIDE;
48
44 protected: 49 protected:
45 // BrowserWindowGtk overrides 50 // BrowserWindowGtk overrides
46 virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE; 51 virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE;
47 virtual bool HandleTitleBarLeftMousePress( 52 virtual bool HandleTitleBarLeftMousePress(
48 GdkEventButton* event, 53 GdkEventButton* event,
49 guint32 last_click_time, 54 guint32 last_click_time,
50 gfx::Point last_click_position) OVERRIDE; 55 gfx::Point last_click_position) OVERRIDE;
51 virtual void SaveWindowPosition() OVERRIDE; 56 virtual void SaveWindowPosition() OVERRIDE;
52 virtual void SetGeometryHints() OVERRIDE; 57 virtual void SetGeometryHints() OVERRIDE;
53 virtual bool UseCustomFrame() OVERRIDE; 58 virtual bool UseCustomFrame() OVERRIDE;
54 virtual void OnSizeChanged(int width, int height) OVERRIDE; 59 virtual void OnSizeChanged(int width, int height) OVERRIDE;
55 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, 60 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget,
56 GdkEventExpose* event) OVERRIDE; 61 GdkEventExpose* event) OVERRIDE;
57 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; 62 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
58 // 'focus-in-event' handler. 63 // 'focus-in-event' handler.
59 virtual void HandleFocusIn(GtkWidget* widget, 64 virtual void HandleFocusIn(GtkWidget* widget,
60 GdkEventFocus* event) OVERRIDE; 65 GdkEventFocus* event) OVERRIDE;
61 66
62
63 // Overridden from NativePanel: 67 // Overridden from NativePanel:
64 virtual void ShowPanel() OVERRIDE; 68 virtual void ShowPanel() OVERRIDE;
65 virtual void ShowPanelInactive() OVERRIDE; 69 virtual void ShowPanelInactive() OVERRIDE;
66 virtual gfx::Rect GetPanelBounds() const OVERRIDE; 70 virtual gfx::Rect GetPanelBounds() const OVERRIDE;
67 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; 71 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE;
68 virtual void ClosePanel() OVERRIDE; 72 virtual void ClosePanel() OVERRIDE;
69 virtual void ActivatePanel() OVERRIDE; 73 virtual void ActivatePanel() OVERRIDE;
70 virtual void DeactivatePanel() OVERRIDE; 74 virtual void DeactivatePanel() OVERRIDE;
71 virtual bool IsPanelActive() const OVERRIDE; 75 virtual bool IsPanelActive() const OVERRIDE;
72 virtual gfx::NativeWindow GetNativePanelHandle() OVERRIDE; 76 virtual gfx::NativeWindow GetNativePanelHandle() OVERRIDE;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::Time disableMinimizeUntilTime_; 181 base::Time disableMinimizeUntilTime_;
178 182
179 // Used to animate the bounds change. 183 // Used to animate the bounds change.
180 scoped_ptr<ui::SlideAnimation> bounds_animator_; 184 scoped_ptr<ui::SlideAnimation> bounds_animator_;
181 gfx::Rect animation_start_bounds_; 185 gfx::Rect animation_start_bounds_;
182 186
183 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); 187 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk);
184 }; 188 };
185 189
186 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ 190 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/panels/panel_browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698