| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "views/view.h" | 9 #include "views/view.h" |
| 10 #include "views/window/client_view.h" | 10 #include "views/window/client_view.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // of it. | 24 // of it. |
| 25 class NonClientFrameView : public View { | 25 class NonClientFrameView : public View { |
| 26 public: | 26 public: |
| 27 // Various edges of the frame border have a 1 px shadow along their edges; in | 27 // Various edges of the frame border have a 1 px shadow along their edges; in |
| 28 // a few cases we shift elements based on this amount for visual appeal. | 28 // a few cases we shift elements based on this amount for visual appeal. |
| 29 static const int kFrameShadowThickness; | 29 static const int kFrameShadowThickness; |
| 30 // In restored mode, we draw a 1 px edge around the content area inside the | 30 // In restored mode, we draw a 1 px edge around the content area inside the |
| 31 // frame border. | 31 // frame border. |
| 32 static const int kClientEdgeThickness; | 32 static const int kClientEdgeThickness; |
| 33 | 33 |
| 34 // Prevent the frame view from painting its inactive state. Prevents a related |
| 35 // window from causing its owner to appear deactivated. Used for windows like |
| 36 // bubbles. |
| 34 void DisableInactiveRendering(bool disable) { | 37 void DisableInactiveRendering(bool disable) { |
| 35 paint_as_active_ = disable; | 38 paint_as_active_ = disable; |
| 36 if (!paint_as_active_) | 39 if (!paint_as_active_) |
| 37 SchedulePaint(); | 40 SchedulePaint(); |
| 38 } | 41 } |
| 39 | 42 |
| 40 // Returns the bounds (in this View's parent's coordinates) that the client | 43 // Returns the bounds (in this View's parent's coordinates) that the client |
| 41 // view should be laid out within. | 44 // view should be laid out within. |
| 42 virtual gfx::Rect GetBoundsForClientView() const = 0; | 45 virtual gfx::Rect GetBoundsForClientView() const = 0; |
| 43 | 46 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 74 // window border the specified |point| falls within. The other parameters are | 77 // window border the specified |point| falls within. The other parameters are |
| 75 // the size of the sizing edges, and whether or not the window can be | 78 // the size of the sizing edges, and whether or not the window can be |
| 76 // resized. | 79 // resized. |
| 77 int GetHTComponentForFrame(const gfx::Point& point, | 80 int GetHTComponentForFrame(const gfx::Point& point, |
| 78 int top_resize_border_height, | 81 int top_resize_border_height, |
| 79 int resize_border_thickness, | 82 int resize_border_thickness, |
| 80 int top_resize_corner_height, | 83 int top_resize_corner_height, |
| 81 int resize_corner_width, | 84 int resize_corner_width, |
| 82 bool can_resize); | 85 bool can_resize); |
| 83 | 86 |
| 84 // Accessor for paint_as_active_. | 87 // Used to determine if the frame should be painted as active. Keyed off the |
| 85 bool paint_as_active() const { return paint_as_active_; } | 88 // window's actual active state and the override, see |
| 89 // DisableInactiveRendering() above. |
| 90 bool ShouldPaintAsActive() const; |
| 86 | 91 |
| 87 private: | 92 private: |
| 88 // True when the non-client view should always be rendered as if the window | 93 // True when the non-client view should always be rendered as if the window |
| 89 // were active, regardless of whether or not the top level window actually | 94 // were active, regardless of whether or not the top level window actually |
| 90 // is active. | 95 // is active. |
| 91 bool paint_as_active_; | 96 bool paint_as_active_; |
| 92 }; | 97 }; |
| 93 | 98 |
| 94 //////////////////////////////////////////////////////////////////////////////// | 99 //////////////////////////////////////////////////////////////////////////////// |
| 95 // NonClientView | 100 // NonClientView |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 229 |
| 225 // The accessible name of this view. | 230 // The accessible name of this view. |
| 226 std::wstring accessible_name_; | 231 std::wstring accessible_name_; |
| 227 | 232 |
| 228 DISALLOW_COPY_AND_ASSIGN(NonClientView); | 233 DISALLOW_COPY_AND_ASSIGN(NonClientView); |
| 229 }; | 234 }; |
| 230 | 235 |
| 231 } // namespace views | 236 } // namespace views |
| 232 | 237 |
| 233 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ | 238 #endif // #ifndef VIEWS_WINDOW_NON_CLIENT_VIEW_H_ |
| OLD | NEW |