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/views/widget/root_view.h" | 9 #include "ui/views/widget/root_view.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return frame_view_->GetEventHandlerForPoint(point_in_child_coords); | 187 return frame_view_->GetEventHandlerForPoint(point_in_child_coords); |
188 } | 188 } |
189 | 189 |
190 return View::GetEventHandlerForPoint(point); | 190 return View::GetEventHandlerForPoint(point); |
191 } | 191 } |
192 | 192 |
193 //////////////////////////////////////////////////////////////////////////////// | 193 //////////////////////////////////////////////////////////////////////////////// |
194 // NonClientFrameView, public: | 194 // NonClientFrameView, public: |
195 | 195 |
196 void NonClientFrameView::SetInactiveRenderingDisabled(bool disable) { | 196 void NonClientFrameView::SetInactiveRenderingDisabled(bool disable) { |
197 // See comment in Widget::SetInactiveRenderingDisabled as to why we don't | 197 if (paint_as_active_ == disable) |
198 // conditionally invoke ShouldPaintAsActiveChanged. | 198 return; |
| 199 |
199 paint_as_active_ = disable; | 200 paint_as_active_ = disable; |
200 ShouldPaintAsActiveChanged(); | 201 ShouldPaintAsActiveChanged(); |
201 } | 202 } |
202 | 203 |
203 int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point, | 204 int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point, |
204 int top_resize_border_height, | 205 int top_resize_border_height, |
205 int resize_border_thickness, | 206 int resize_border_thickness, |
206 int top_resize_corner_height, | 207 int top_resize_corner_height, |
207 int resize_corner_width, | 208 int resize_corner_width, |
208 bool can_resize) { | 209 bool can_resize) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 260 } |
260 | 261 |
261 //////////////////////////////////////////////////////////////////////////////// | 262 //////////////////////////////////////////////////////////////////////////////// |
262 // NonClientFrameView, protected: | 263 // NonClientFrameView, protected: |
263 | 264 |
264 bool NonClientFrameView::ShouldPaintAsActive() const { | 265 bool NonClientFrameView::ShouldPaintAsActive() const { |
265 return GetWidget()->IsActive() || paint_as_active_; | 266 return GetWidget()->IsActive() || paint_as_active_; |
266 } | 267 } |
267 | 268 |
268 void NonClientFrameView::ShouldPaintAsActiveChanged() { | 269 void NonClientFrameView::ShouldPaintAsActiveChanged() { |
269 if (!paint_as_active_) | 270 SchedulePaint(); |
270 SchedulePaint(); | |
271 } | 271 } |
272 | 272 |
273 void NonClientFrameView::GetAccessibleState(ui::AccessibleViewState* state) { | 273 void NonClientFrameView::GetAccessibleState(ui::AccessibleViewState* state) { |
274 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 274 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
275 } | 275 } |
276 | 276 |
277 std::string NonClientFrameView::GetClassName() const { | 277 std::string NonClientFrameView::GetClassName() const { |
278 return kViewClassName; | 278 return kViewClassName; |
279 } | 279 } |
280 | 280 |
281 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 281 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
282 // Overridden to do nothing. The NonClientView manually calls Layout on the | 282 // Overridden to do nothing. The NonClientView manually calls Layout on the |
283 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 283 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
284 } | 284 } |
285 | 285 |
286 } // namespace views | 286 } // namespace views |
OLD | NEW |