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 #include "ui/views/window/non_client_view.h" | 5 #include "ui/views/window/non_client_view.h" |
6 | 6 |
7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
9 #include "ui/gfx/rect_conversions.h" | 9 #include "ui/gfx/rect_conversions.h" |
10 #include "ui/views/rect_based_targeting_utils.h" | 10 #include "ui/views/rect_based_targeting_utils.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // We need to manually call Layout here because layout for the frame view can | 120 // We need to manually call Layout here because layout for the frame view can |
121 // change independently of the bounds changing - e.g. after the initial | 121 // change independently of the bounds changing - e.g. after the initial |
122 // display of the window the metrics of the native window controls can change, | 122 // display of the window the metrics of the native window controls can change, |
123 // which does not change the bounds of the window but requires a re-layout to | 123 // which does not change the bounds of the window but requires a re-layout to |
124 // trigger a repaint. We override OnBoundsChanged() for the NonClientFrameView | 124 // trigger a repaint. We override OnBoundsChanged() for the NonClientFrameView |
125 // to do nothing so that SetBounds above doesn't cause Layout to be called | 125 // to do nothing so that SetBounds above doesn't cause Layout to be called |
126 // twice. | 126 // twice. |
127 frame_view_->Layout(); | 127 frame_view_->Layout(); |
128 } | 128 } |
129 | 129 |
130 void NonClientView::SetAccessibleName(const string16& name) { | 130 void NonClientView::SetAccessibleName(const base::string16& name) { |
131 accessible_name_ = name; | 131 accessible_name_ = name; |
132 } | 132 } |
133 | 133 |
134 //////////////////////////////////////////////////////////////////////////////// | 134 //////////////////////////////////////////////////////////////////////////////// |
135 // NonClientView, View overrides: | 135 // NonClientView, View overrides: |
136 | 136 |
137 gfx::Size NonClientView::GetPreferredSize() { | 137 gfx::Size NonClientView::GetPreferredSize() { |
138 // TODO(pkasting): This should probably be made to look similar to | 138 // TODO(pkasting): This should probably be made to look similar to |
139 // GetMinimumSize() below. This will require implementing GetPreferredSize() | 139 // GetMinimumSize() below. This will require implementing GetPreferredSize() |
140 // better in the various frame views. | 140 // better in the various frame views. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const char* NonClientFrameView::GetClassName() const { | 316 const char* NonClientFrameView::GetClassName() const { |
317 return kViewClassName; | 317 return kViewClassName; |
318 } | 318 } |
319 | 319 |
320 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 320 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
321 // Overridden to do nothing. The NonClientView manually calls Layout on the | 321 // Overridden to do nothing. The NonClientView manually calls Layout on the |
322 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 322 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
323 } | 323 } |
324 | 324 |
325 } // namespace views | 325 } // namespace views |
OLD | NEW |