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 VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 5 #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
6 #define VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 6 #define VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "views/view.h" | 10 #include "views/view.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void DisableInactiveRendering(bool disable) { | 38 void DisableInactiveRendering(bool disable) { |
39 paint_as_active_ = disable; | 39 paint_as_active_ = disable; |
40 if (!paint_as_active_) | 40 if (!paint_as_active_) |
41 SchedulePaint(); | 41 SchedulePaint(); |
42 } | 42 } |
43 | 43 |
44 // Returns the bounds (in this View's parent's coordinates) that the client | 44 // Returns the bounds (in this View's parent's coordinates) that the client |
45 // view should be laid out within. | 45 // view should be laid out within. |
46 virtual gfx::Rect GetBoundsForClientView() const = 0; | 46 virtual gfx::Rect GetBoundsForClientView() const = 0; |
47 | 47 |
48 // Returns true if this FrameView should always use the custom frame, | |
49 // regardless of the system settings. An example is the Constrained Window, | |
50 // which is a child window and must always provide its own frame. | |
51 virtual bool AlwaysUseCustomFrame() const; | |
52 | |
53 // Like AlwaysUseCustomFrame, returns true if this FrameView should always use | |
54 // the native frame, regardless of theme settings. An example is popup/app | |
55 // windows, which we do not ever want to show themed. | |
56 virtual bool AlwaysUseNativeFrame() const; | |
57 | |
58 virtual gfx::Rect GetWindowBoundsForClientBounds( | 48 virtual gfx::Rect GetWindowBoundsForClientBounds( |
59 const gfx::Rect& client_bounds) const = 0; | 49 const gfx::Rect& client_bounds) const = 0; |
60 | 50 |
61 // This function must ask the ClientView to do a hittest. We don't do this in | 51 // This function must ask the ClientView to do a hittest. We don't do this in |
62 // the parent NonClientView because that makes it more difficult to calculate | 52 // the parent NonClientView because that makes it more difficult to calculate |
63 // hittests for regions that are partially obscured by the ClientView, e.g. | 53 // hittests for regions that are partially obscured by the ClientView, e.g. |
64 // HTSYSMENU. | 54 // HTSYSMENU. |
65 virtual int NonClientHitTest(const gfx::Point& point) = 0; | 55 virtual int NonClientHitTest(const gfx::Point& point) = 0; |
66 virtual void GetWindowMask(const gfx::Size& size, | 56 virtual void GetWindowMask(const gfx::Size& size, |
67 gfx::Path* window_mask) = 0; | 57 gfx::Path* window_mask) = 0; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // closed, false otherwise. | 144 // closed, false otherwise. |
155 bool CanClose(); | 145 bool CanClose(); |
156 | 146 |
157 // Called by the containing Window when it is closed. | 147 // Called by the containing Window when it is closed. |
158 void WindowClosing(); | 148 void WindowClosing(); |
159 | 149 |
160 // Changes the frame from native to custom depending on the value of | 150 // Changes the frame from native to custom depending on the value of |
161 // |use_native_frame|. | 151 // |use_native_frame|. |
162 void UpdateFrame(); | 152 void UpdateFrame(); |
163 | 153 |
164 // Returns true if the native window frame should be used, false if the | |
165 // NonClientView provides its own frame implementation. | |
166 bool UseNativeFrame() const; | |
167 | |
168 // Prevents the window from being rendered as deactivated when |disable| is | 154 // Prevents the window from being rendered as deactivated when |disable| is |
169 // true, until called with |disable| false. Used when a sub-window is to be | 155 // true, until called with |disable| false. Used when a sub-window is to be |
170 // shown that shouldn't visually de-activate the window. | 156 // shown that shouldn't visually de-activate the window. |
171 // Subclasses can override this to perform additional actions when this value | 157 // Subclasses can override this to perform additional actions when this value |
172 // changes. | 158 // changes. |
173 void DisableInactiveRendering(bool disable); | 159 void DisableInactiveRendering(bool disable); |
174 | 160 |
175 // Returns the bounds of the window required to display the content area at | 161 // Returns the bounds of the window required to display the content area at |
176 // the specified bounds. | 162 // the specified bounds. |
177 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; | 163 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 228 |
243 // The accessible name of this view. | 229 // The accessible name of this view. |
244 string16 accessible_name_; | 230 string16 accessible_name_; |
245 | 231 |
246 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 232 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
247 }; | 233 }; |
248 | 234 |
249 } // namespace views | 235 } // namespace views |
250 | 236 |
251 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 237 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
OLD | NEW |