OLD | NEW |
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 UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
6 #define UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/views/window/client_view.h" | 9 #include "ui/views/window/client_view.h" |
10 #include "views/view.h" | 10 #include "views/view.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 virtual gfx::Rect GetWindowBoundsForClientBounds( | 46 virtual gfx::Rect GetWindowBoundsForClientBounds( |
47 const gfx::Rect& client_bounds) const = 0; | 47 const gfx::Rect& client_bounds) const = 0; |
48 | 48 |
49 // This function must ask the ClientView to do a hittest. We don't do this in | 49 // This function must ask the ClientView to do a hittest. We don't do this in |
50 // the parent NonClientView because that makes it more difficult to calculate | 50 // the parent NonClientView because that makes it more difficult to calculate |
51 // hittests for regions that are partially obscured by the ClientView, e.g. | 51 // hittests for regions that are partially obscured by the ClientView, e.g. |
52 // HTSYSMENU. | 52 // HTSYSMENU. |
53 virtual int NonClientHitTest(const gfx::Point& point) = 0; | 53 virtual int NonClientHitTest(const gfx::Point& point) = 0; |
54 virtual void GetWindowMask(const gfx::Size& size, | 54 virtual void GetWindowMask(const gfx::Size& size, |
55 gfx::Path* window_mask) = 0; | 55 gfx::Path* window_mask) = 0; |
56 virtual void EnableClose(bool enable) = 0; | |
57 virtual void ResetWindowControls() = 0; | 56 virtual void ResetWindowControls() = 0; |
58 virtual void UpdateWindowIcon() = 0; | 57 virtual void UpdateWindowIcon() = 0; |
59 | 58 |
60 // Overridden from View: | 59 // Overridden from View: |
61 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 60 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; |
62 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 61 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
63 virtual std::string GetClassName() const OVERRIDE; | 62 virtual std::string GetClassName() const OVERRIDE; |
64 | 63 |
65 protected: | 64 protected: |
66 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 65 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; | 167 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; |
169 | 168 |
170 // Determines the windows HT* code when the mouse cursor is at the | 169 // Determines the windows HT* code when the mouse cursor is at the |
171 // specified point, in window coordinates. | 170 // specified point, in window coordinates. |
172 int NonClientHitTest(const gfx::Point& point); | 171 int NonClientHitTest(const gfx::Point& point); |
173 | 172 |
174 // Returns a mask to be used to clip the top level window for the given | 173 // Returns a mask to be used to clip the top level window for the given |
175 // size. This is used to create the non-rectangular window shape. | 174 // size. This is used to create the non-rectangular window shape. |
176 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); | 175 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); |
177 | 176 |
178 // Toggles the enable state for the Close button (and the Close menu item in | |
179 // the system menu). | |
180 void EnableClose(bool enable); | |
181 | |
182 // Tells the window controls as rendered by the NonClientView to reset | 177 // Tells the window controls as rendered by the NonClientView to reset |
183 // themselves to a normal state. This happens in situations where the | 178 // themselves to a normal state. This happens in situations where the |
184 // containing window does not receive a normal sequences of messages that | 179 // containing window does not receive a normal sequences of messages that |
185 // would lead to the controls returning to this normal state naturally, e.g. | 180 // would lead to the controls returning to this normal state naturally, e.g. |
186 // when the window is maximized, minimized or restored. | 181 // when the window is maximized, minimized or restored. |
187 void ResetWindowControls(); | 182 void ResetWindowControls(); |
188 | 183 |
189 // Tells the NonClientView to invalidate the NonClientFrameView's window icon. | 184 // Tells the NonClientView to invalidate the NonClientFrameView's window icon. |
190 void UpdateWindowIcon(); | 185 void UpdateWindowIcon(); |
191 | 186 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 226 |
232 // The accessible name of this view. | 227 // The accessible name of this view. |
233 string16 accessible_name_; | 228 string16 accessible_name_; |
234 | 229 |
235 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 230 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
236 }; | 231 }; |
237 | 232 |
238 } // namespace views | 233 } // namespace views |
239 | 234 |
240 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 235 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
OLD | NEW |