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

Side by Side Diff: views/window/native_window_gtk.h

Issue 7075019: Move a bunch of functions from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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 VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ 5 #ifndef VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_
6 #define VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ 6 #define VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "views/widget/native_widget_gtk.h" 10 #include "views/widget/native_widget_gtk.h"
(...skipping 21 matching lines...) Expand all
32 32
33 virtual Window* GetWindow() OVERRIDE; 33 virtual Window* GetWindow() OVERRIDE;
34 virtual const Window* GetWindow() const OVERRIDE; 34 virtual const Window* GetWindow() const OVERRIDE;
35 35
36 // Overridden from NativeWidgetGtk: 36 // Overridden from NativeWidgetGtk:
37 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); 37 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event);
38 virtual gboolean OnConfigureEvent(GtkWidget* widget, 38 virtual gboolean OnConfigureEvent(GtkWidget* widget,
39 GdkEventConfigure* event); 39 GdkEventConfigure* event);
40 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event); 40 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event);
41 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation); 41 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation);
42 virtual gboolean OnWindowStateEvent(GtkWidget* widget,
43 GdkEventWindowState* event);
44 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); 42 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
45 virtual void IsActiveChanged(); 43 virtual void IsActiveChanged();
46 44
47 protected: 45 protected:
48 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; 46 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
49 47
50 // Overridden from NativeWindow: 48 // Overridden from NativeWindow:
51 virtual NativeWidget* AsNativeWidget() OVERRIDE; 49 virtual NativeWidget* AsNativeWidget() OVERRIDE;
52 virtual const NativeWidget* AsNativeWidget() const OVERRIDE; 50 virtual const NativeWidget* AsNativeWidget() const OVERRIDE;
53 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; 51 virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
54 virtual void ShowNativeWindow(ShowState state) OVERRIDE; 52 virtual void ShowNativeWindow(ShowState state) OVERRIDE;
55 virtual void BecomeModal() OVERRIDE; 53 virtual void BecomeModal() OVERRIDE;
56 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; 54 virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
57 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, 55 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds,
58 bool* maximized) const OVERRIDE; 56 bool* maximized) const OVERRIDE;
59 virtual void EnableClose(bool enable) OVERRIDE; 57 virtual void EnableClose(bool enable) OVERRIDE;
60 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; 58 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE;
61 virtual void SetWindowIcons(const SkBitmap& window_icon, 59 virtual void SetWindowIcons(const SkBitmap& window_icon,
62 const SkBitmap& app_icon) OVERRIDE; 60 const SkBitmap& app_icon) OVERRIDE;
63 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; 61 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE;
64 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; 62 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE;
65 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; 63 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE;
66 virtual void SetWindowBounds(const gfx::Rect& bounds, 64 virtual void SetWindowBounds(const gfx::Rect& bounds,
67 gfx::NativeWindow other_window) OVERRIDE; 65 gfx::NativeWindow other_window) OVERRIDE;
68 virtual void HideWindow() OVERRIDE;
69 virtual void Activate() OVERRIDE;
70 virtual void Deactivate() OVERRIDE;
71 virtual void Maximize() OVERRIDE;
72 virtual void Minimize() OVERRIDE;
73 virtual void Restore() OVERRIDE;
74 virtual bool IsActive() const OVERRIDE;
75 virtual bool IsVisible() const OVERRIDE;
76 virtual bool IsMaximized() const OVERRIDE;
77 virtual bool IsMinimized() const OVERRIDE;
78 virtual void SetFullscreen(bool fullscreen) OVERRIDE; 66 virtual void SetFullscreen(bool fullscreen) OVERRIDE;
79 virtual bool IsFullscreen() const OVERRIDE; 67 virtual bool IsFullscreen() const OVERRIDE;
80 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
81 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE; 68 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
82 virtual NonClientFrameView* CreateFrameViewForWindow() OVERRIDE; 69 virtual NonClientFrameView* CreateFrameViewForWindow() OVERRIDE;
83 virtual void UpdateFrameAfterFrameChange() OVERRIDE; 70 virtual void UpdateFrameAfterFrameChange() OVERRIDE;
84 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; 71 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
85 virtual bool ShouldUseNativeFrame() const OVERRIDE; 72 virtual bool ShouldUseNativeFrame() const OVERRIDE;
86 virtual void FrameTypeChanged() OVERRIDE; 73 virtual void FrameTypeChanged() OVERRIDE;
87 74
75 // Overridden from NativeWidgetGtk:
76 virtual void Restore() OVERRIDE;
77 virtual gboolean OnWindowStateEvent(GtkWidget* widget,
78 GdkEventWindowState* event) OVERRIDE;
79
88 // For the constructor. 80 // For the constructor.
89 friend class Window; 81 friend class Window;
90 82
91 virtual void OnDestroy(GtkWidget* widget); 83 virtual void OnDestroy(GtkWidget* widget);
92 84
93 private: 85 private:
94 static gboolean CallConfigureEvent(GtkWidget* widget, 86 static gboolean CallConfigureEvent(GtkWidget* widget,
95 GdkEventConfigure* event, 87 GdkEventConfigure* event,
96 NativeWindowGtk* window_gtk); 88 NativeWindowGtk* window_gtk);
97 static gboolean CallWindowStateEvent(GtkWidget* widget,
98 GdkEventWindowState* event,
99 NativeWindowGtk* window_gtk);
100 89
101 // Asks the delegate if any to save the window's location and size. 90 // Asks the delegate if any to save the window's location and size.
102 void SaveWindowPosition(); 91 void SaveWindowPosition();
103 92
104 // A delegate implementation that handles events received here. 93 // A delegate implementation that handles events received here.
105 internal::NativeWindowDelegate* delegate_; 94 internal::NativeWindowDelegate* delegate_;
106 95
107 // Our window delegate. 96 // Our window delegate.
108 WindowDelegate* window_delegate_; 97 WindowDelegate* window_delegate_;
109 98
110 // The View that provides the non-client area of the window (title bar, 99 // The View that provides the non-client area of the window (title bar,
111 // window controls, sizing borders etc). To use an implementation other than 100 // window controls, sizing borders etc). To use an implementation other than
112 // the default, this class must be subclassed and this value set to the 101 // the default, this class must be subclassed and this value set to the
113 // desired implementation before calling |Init|. 102 // desired implementation before calling |Init|.
114 NonClientView* non_client_view_; 103 NonClientView* non_client_view_;
115 104
116 // State of the window, such as fullscreen, hidden...
117 GdkWindowState window_state_;
118
119 // Set to true if the window is in the process of closing. 105 // Set to true if the window is in the process of closing.
120 bool window_closed_; 106 bool window_closed_;
121 107
122 DISALLOW_COPY_AND_ASSIGN(NativeWindowGtk); 108 DISALLOW_COPY_AND_ASSIGN(NativeWindowGtk);
123 }; 109 };
124 110
125 } // namespace views 111 } // namespace views
126 112
127 #endif // VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ 113 #endif // VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698