| 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 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 | 7 |
| 8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Helper for non-client view implementations to determine which area of the | 42 // Helper for non-client view implementations to determine which area of the |
| 43 // window border the specified |point| falls within. The other parameters are | 43 // window border the specified |point| falls within. The other parameters are |
| 44 // the size of the sizing edges, and whether or not the window can be | 44 // the size of the sizing edges, and whether or not the window can be |
| 45 // resized. | 45 // resized. |
| 46 int GetHTComponentForFrame(const gfx::Point& point, | 46 int GetHTComponentForFrame(const gfx::Point& point, |
| 47 int top_resize_border_height, | 47 int top_resize_border_height, |
| 48 int resize_border_thickness, | 48 int resize_border_thickness, |
| 49 int top_resize_corner_height, | 49 int top_resize_corner_height, |
| 50 int resize_corner_width, | 50 int resize_corner_width, |
| 51 bool can_resize); | 51 bool can_resize) const; |
| 52 | 52 |
| 53 // Returns the bounds (in this View's parent's coordinates) that the client | 53 // Returns the bounds (in this View's parent's coordinates) that the client |
| 54 // view should be laid out within. | 54 // view should be laid out within. |
| 55 virtual gfx::Rect GetBoundsForClientView() const = 0; | 55 virtual gfx::Rect GetBoundsForClientView() const = 0; |
| 56 | 56 |
| 57 virtual gfx::Rect GetWindowBoundsForClientBounds( | 57 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 58 const gfx::Rect& client_bounds) const = 0; | 58 const gfx::Rect& client_bounds) const = 0; |
| 59 | 59 |
| 60 // This function must ask the ClientView to do a hittest. We don't do this in | 60 // This function must ask the ClientView to do a hittest. We don't do this in |
| 61 // the parent NonClientView because that makes it more difficult to calculate | 61 // the parent NonClientView because that makes it more difficult to calculate |
| 62 // hittests for regions that are partially obscured by the ClientView, e.g. | 62 // hittests for regions that are partially obscured by the ClientView, e.g. |
| 63 // HTSYSMENU. | 63 // HTSYSMENU. |
| 64 virtual int NonClientHitTest(const gfx::Point& point) = 0; | 64 virtual int NonClientHitTest(const gfx::Point& point) const = 0; |
| 65 virtual void GetWindowMask(const gfx::Size& size, | 65 virtual void GetWindowMask(const gfx::Size& size, |
| 66 gfx::Path* window_mask) = 0; | 66 gfx::Path* window_mask) = 0; |
| 67 virtual void ResetWindowControls() = 0; | 67 virtual void ResetWindowControls() = 0; |
| 68 virtual void UpdateWindowIcon() = 0; | 68 virtual void UpdateWindowIcon() = 0; |
| 69 virtual void UpdateWindowTitle() = 0; | 69 virtual void UpdateWindowTitle() = 0; |
| 70 | 70 |
| 71 // Overridden from View: | 71 // Overridden from View: |
| 72 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 72 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
| 73 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 73 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 74 virtual const char* GetClassName() const OVERRIDE; | 74 virtual const char* GetClassName() const OVERRIDE; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Subclasses can override this to perform additional actions when this value | 166 // Subclasses can override this to perform additional actions when this value |
| 167 // changes. | 167 // changes. |
| 168 void SetInactiveRenderingDisabled(bool disable); | 168 void SetInactiveRenderingDisabled(bool disable); |
| 169 | 169 |
| 170 // Returns the bounds of the window required to display the content area at | 170 // Returns the bounds of the window required to display the content area at |
| 171 // the specified bounds. | 171 // the specified bounds. |
| 172 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; | 172 gfx::Rect GetWindowBoundsForClientBounds(const gfx::Rect client_bounds) const; |
| 173 | 173 |
| 174 // Determines the windows HT* code when the mouse cursor is at the | 174 // Determines the windows HT* code when the mouse cursor is at the |
| 175 // specified point, in window coordinates. | 175 // specified point, in window coordinates. |
| 176 int NonClientHitTest(const gfx::Point& point); | 176 int NonClientHitTest(const gfx::Point& point) const; |
| 177 | 177 |
| 178 // Returns a mask to be used to clip the top level window for the given | 178 // Returns a mask to be used to clip the top level window for the given |
| 179 // size. This is used to create the non-rectangular window shape. | 179 // size. This is used to create the non-rectangular window shape. |
| 180 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); | 180 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); |
| 181 | 181 |
| 182 // Tells the window controls as rendered by the NonClientView to reset | 182 // Tells the window controls as rendered by the NonClientView to reset |
| 183 // themselves to a normal state. This happens in situations where the | 183 // themselves to a normal state. This happens in situations where the |
| 184 // containing window does not receive a normal sequences of messages that | 184 // 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. | 185 // would lead to the controls returning to this normal state naturally, e.g. |
| 186 // when the window is maximized, minimized or restored. | 186 // when the window is maximized, minimized or restored. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 // The accessible name of this view. | 243 // The accessible name of this view. |
| 244 string16 accessible_name_; | 244 string16 accessible_name_; |
| 245 | 245 |
| 246 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 246 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 } // namespace views | 249 } // namespace views |
| 250 | 250 |
| 251 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 251 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
| OLD | NEW |