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 #include "ui/views/view_targeter_delegate.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 enum { | 32 enum { |
33 // 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; |
34 // 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. |
35 kFrameShadowThickness = 1, | 35 kFrameShadowThickness = 1, |
36 | 36 |
37 // 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 |
38 // frame border. | 38 // frame border. |
39 kClientEdgeThickness = 1, | 39 kClientEdgeThickness = 1, |
40 }; | 40 }; |
41 | 41 |
42 virtual ~NonClientFrameView(); | 42 ~NonClientFrameView() override; |
43 | 43 |
44 // Sets whether the window should be rendered as active regardless of the | 44 // Sets whether the window should be rendered as active regardless of the |
45 // actual active state. Used when bubbles become active to make their parent | 45 // actual active state. Used when bubbles become active to make their parent |
46 // appear active. A value of true makes the window render as active always, | 46 // appear active. A value of true makes the window render as active always, |
47 // false gives normal behavior. | 47 // false gives normal behavior. |
48 void SetInactiveRenderingDisabled(bool disable); | 48 void SetInactiveRenderingDisabled(bool disable); |
49 | 49 |
50 // Used to determine if the frame should be painted as active. Keyed off the | 50 // Used to determine if the frame should be painted as active. Keyed off the |
51 // window's actual active state and |inactive_rendering_disabled_|. | 51 // window's actual active state and |inactive_rendering_disabled_|. |
52 bool ShouldPaintAsActive() const; | 52 bool ShouldPaintAsActive() const; |
(...skipping 22 matching lines...) Expand all Loading... |
75 // HTSYSMENU. | 75 // HTSYSMENU. |
76 virtual int NonClientHitTest(const gfx::Point& point) = 0; | 76 virtual int NonClientHitTest(const gfx::Point& point) = 0; |
77 virtual void GetWindowMask(const gfx::Size& size, | 77 virtual void GetWindowMask(const gfx::Size& size, |
78 gfx::Path* window_mask) = 0; | 78 gfx::Path* window_mask) = 0; |
79 virtual void ResetWindowControls() = 0; | 79 virtual void ResetWindowControls() = 0; |
80 virtual void UpdateWindowIcon() = 0; | 80 virtual void UpdateWindowIcon() = 0; |
81 virtual void UpdateWindowTitle() = 0; | 81 virtual void UpdateWindowTitle() = 0; |
82 virtual void SizeConstraintsChanged() = 0; | 82 virtual void SizeConstraintsChanged() = 0; |
83 | 83 |
84 // View: | 84 // View: |
85 virtual void GetAccessibleState(ui::AXViewState* state) override; | 85 void GetAccessibleState(ui::AXViewState* state) override; |
86 virtual const char* GetClassName() const override; | 86 const char* GetClassName() const override; |
87 | 87 |
88 protected: | 88 protected: |
89 NonClientFrameView(); | 89 NonClientFrameView(); |
90 | 90 |
91 // ViewTargeterDelegate: | 91 // ViewTargeterDelegate: |
92 virtual bool DoesIntersectRect(const View* target, | 92 bool DoesIntersectRect(const View* target, |
93 const gfx::Rect& rect) const override; | 93 const gfx::Rect& rect) const override; |
94 | 94 |
95 // View: | 95 // View: |
96 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 96 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
97 | 97 |
98 private: | 98 private: |
99 // Prevents the non-client frame view from being rendered as inactive when | 99 // Prevents the non-client frame view from being rendered as inactive when |
100 // true. | 100 // true. |
101 bool inactive_rendering_disabled_; | 101 bool inactive_rendering_disabled_; |
102 }; | 102 }; |
103 | 103 |
104 //////////////////////////////////////////////////////////////////////////////// | 104 //////////////////////////////////////////////////////////////////////////////// |
105 // NonClientView | 105 // NonClientView |
106 // | 106 // |
(...skipping 29 matching lines...) Expand all Loading... |
136 // changes the NonClientFrameView may be replaced with different | 136 // changes the NonClientFrameView may be replaced with different |
137 // implementations (e.g. during the switch from DWM/Aero-Glass to Vista Basic/ | 137 // implementations (e.g. during the switch from DWM/Aero-Glass to Vista Basic/ |
138 // Classic rendering). | 138 // Classic rendering). |
139 // | 139 // |
140 class VIEWS_EXPORT NonClientView : public View, public ViewTargeterDelegate { | 140 class VIEWS_EXPORT NonClientView : public View, public ViewTargeterDelegate { |
141 public: | 141 public: |
142 // Internal class name. | 142 // Internal class name. |
143 static const char kViewClassName[]; | 143 static const char kViewClassName[]; |
144 | 144 |
145 NonClientView(); | 145 NonClientView(); |
146 virtual ~NonClientView(); | 146 ~NonClientView() override; |
147 | 147 |
148 // Returns the current NonClientFrameView instance, or NULL if | 148 // Returns the current NonClientFrameView instance, or NULL if |
149 // it does not exist. | 149 // it does not exist. |
150 NonClientFrameView* frame_view() const { return frame_view_.get(); } | 150 NonClientFrameView* frame_view() const { return frame_view_.get(); } |
151 | 151 |
152 // Replaces the current NonClientFrameView (if any) with the specified one. | 152 // Replaces the current NonClientFrameView (if any) with the specified one. |
153 void SetFrameView(NonClientFrameView* frame_view); | 153 void SetFrameView(NonClientFrameView* frame_view); |
154 | 154 |
155 // Replaces the current |overlay_view_| (if any) with the specified one. | 155 // Replaces the current |overlay_view_| (if any) with the specified one. |
156 void SetOverlayView(View* view); | 156 void SetOverlayView(View* view); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 // Layout just the frame view. This is necessary on Windows when non-client | 209 // Layout just the frame view. This is necessary on Windows when non-client |
210 // metrics such as the position of the window controls changes independently | 210 // metrics such as the position of the window controls changes independently |
211 // of a window resize message. | 211 // of a window resize message. |
212 void LayoutFrameView(); | 212 void LayoutFrameView(); |
213 | 213 |
214 // Set the accessible name of this view. | 214 // Set the accessible name of this view. |
215 void SetAccessibleName(const base::string16& name); | 215 void SetAccessibleName(const base::string16& name); |
216 | 216 |
217 // NonClientView, View overrides: | 217 // NonClientView, View overrides: |
218 virtual gfx::Size GetPreferredSize() const override; | 218 gfx::Size GetPreferredSize() const override; |
219 virtual gfx::Size GetMinimumSize() const override; | 219 gfx::Size GetMinimumSize() const override; |
220 virtual gfx::Size GetMaximumSize() const override; | 220 gfx::Size GetMaximumSize() const override; |
221 virtual void Layout() override; | 221 void Layout() override; |
222 virtual void GetAccessibleState(ui::AXViewState* state) override; | 222 void GetAccessibleState(ui::AXViewState* state) override; |
223 virtual const char* GetClassName() const override; | 223 const char* GetClassName() const override; |
224 | 224 |
225 virtual views::View* GetTooltipHandlerForPoint( | 225 views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; |
226 const gfx::Point& point) override; | |
227 | 226 |
228 protected: | 227 protected: |
229 // NonClientView, View overrides: | 228 // NonClientView, View overrides: |
230 virtual void ViewHierarchyChanged( | 229 void ViewHierarchyChanged( |
231 const ViewHierarchyChangedDetails& details) override; | 230 const ViewHierarchyChangedDetails& details) override; |
232 | 231 |
233 private: | 232 private: |
234 // ViewTargeterDelegate: | 233 // ViewTargeterDelegate: |
235 virtual View* TargetForRect(View* root, const gfx::Rect& rect) override; | 234 View* TargetForRect(View* root, const gfx::Rect& rect) override; |
236 | 235 |
237 // A ClientView object or subclass, responsible for sizing the contents view | 236 // A ClientView object or subclass, responsible for sizing the contents view |
238 // of the window, hit testing and perhaps other tasks depending on the | 237 // of the window, hit testing and perhaps other tasks depending on the |
239 // implementation. | 238 // implementation. |
240 ClientView* client_view_; | 239 ClientView* client_view_; |
241 | 240 |
242 // The NonClientFrameView that renders the non-client portions of the window. | 241 // The NonClientFrameView that renders the non-client portions of the window. |
243 // This object is not owned by the view hierarchy because it can be replaced | 242 // This object is not owned by the view hierarchy because it can be replaced |
244 // dynamically as the system settings change. | 243 // dynamically as the system settings change. |
245 scoped_ptr<NonClientFrameView> frame_view_; | 244 scoped_ptr<NonClientFrameView> frame_view_; |
246 | 245 |
247 // The overlay view, when non-NULL and visible, takes up the entire widget and | 246 // The overlay view, when non-NULL and visible, takes up the entire widget and |
248 // is placed on top of the ClientView and NonClientFrameView. | 247 // is placed on top of the ClientView and NonClientFrameView. |
249 View* overlay_view_; | 248 View* overlay_view_; |
250 | 249 |
251 // The accessible name of this view. | 250 // The accessible name of this view. |
252 base::string16 accessible_name_; | 251 base::string16 accessible_name_; |
253 | 252 |
254 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 253 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
255 }; | 254 }; |
256 | 255 |
257 } // namespace views | 256 } // namespace views |
258 | 257 |
259 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 258 #endif // UI_VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
OLD | NEW |