| 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 #include "ui/views/view_targeter_delegate.h" |
| 9 | 10 |
| 10 namespace gfx { | 11 namespace gfx { |
| 11 class Path; | 12 class Path; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace views { | 15 namespace views { |
| 15 | 16 |
| 16 class ClientView; | 17 class ClientView; |
| 17 | 18 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 19 // NonClientFrameView | 20 // NonClientFrameView |
| 20 // | 21 // |
| 21 // An object that subclasses NonClientFrameView is a View that renders and | 22 // An object that subclasses NonClientFrameView is a View that renders and |
| 22 // responds to events within the frame portions of the non-client area of a | 23 // responds to events within the frame portions of the non-client area of a |
| 23 // window. This view does _not_ contain the ClientView, but rather is a sibling | 24 // window. This view does _not_ contain the ClientView, but rather is a sibling |
| 24 // of it. | 25 // of it. |
| 25 class VIEWS_EXPORT NonClientFrameView : public View { | 26 class VIEWS_EXPORT NonClientFrameView : public View, |
| 27 public ViewTargeterDelegate { |
| 26 public: | 28 public: |
| 27 // Internal class name. | 29 // Internal class name. |
| 28 static const char kViewClassName[]; | 30 static const char kViewClassName[]; |
| 29 | 31 |
| 30 enum { | 32 enum { |
| 31 // Various edges of the frame border have a 1 px shadow along their edges; | 33 // Various edges of the frame border have a 1 px shadow along their edges; |
| 32 // in a few cases we shift elements based on this amount for visual appeal. | 34 // in a few cases we shift elements based on this amount for visual appeal. |
| 33 kFrameShadowThickness = 1, | 35 kFrameShadowThickness = 1, |
| 34 | 36 |
| 35 // In restored mode, we draw a 1 px edge around the content area inside the | 37 // In restored mode, we draw a 1 px edge around the content area inside the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // the parent NonClientView because that makes it more difficult to calculate | 73 // the parent NonClientView because that makes it more difficult to calculate |
| 72 // hittests for regions that are partially obscured by the ClientView, e.g. | 74 // hittests for regions that are partially obscured by the ClientView, e.g. |
| 73 // HTSYSMENU. | 75 // HTSYSMENU. |
| 74 virtual int NonClientHitTest(const gfx::Point& point) = 0; | 76 virtual int NonClientHitTest(const gfx::Point& point) = 0; |
| 75 virtual void GetWindowMask(const gfx::Size& size, | 77 virtual void GetWindowMask(const gfx::Size& size, |
| 76 gfx::Path* window_mask) = 0; | 78 gfx::Path* window_mask) = 0; |
| 77 virtual void ResetWindowControls() = 0; | 79 virtual void ResetWindowControls() = 0; |
| 78 virtual void UpdateWindowIcon() = 0; | 80 virtual void UpdateWindowIcon() = 0; |
| 79 virtual void UpdateWindowTitle() = 0; | 81 virtual void UpdateWindowTitle() = 0; |
| 80 | 82 |
| 81 // Overridden from View: | 83 // View: |
| 82 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | |
| 83 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 84 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 84 virtual const char* GetClassName() const OVERRIDE; | 85 virtual const char* GetClassName() const OVERRIDE; |
| 85 | 86 |
| 87 // ViewTargeterDelegate: |
| 88 virtual bool DoesIntersectRect(const View* target, |
| 89 const gfx::Rect& rect) const OVERRIDE; |
| 90 |
| 86 protected: | 91 protected: |
| 87 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 92 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 88 | 93 |
| 89 NonClientFrameView(); | 94 NonClientFrameView(); |
| 90 | 95 |
| 91 private: | 96 private: |
| 92 // Prevents the non-client frame view from being rendered as inactive when | 97 // Prevents the non-client frame view from being rendered as inactive when |
| 93 // true. | 98 // true. |
| 94 bool inactive_rendering_disabled_; | 99 bool inactive_rendering_disabled_; |
| 95 }; | 100 }; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 243 |
| 239 // The accessible name of this view. | 244 // The accessible name of this view. |
| 240 base::string16 accessible_name_; | 245 base::string16 accessible_name_; |
| 241 | 246 |
| 242 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 247 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
| 243 }; | 248 }; |
| 244 | 249 |
| 245 } // namespace views | 250 } // namespace views |
| 246 | 251 |
| 247 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 252 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
| OLD | NEW |