| 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/widget/root_view.h" | 5 #include "ui/views/widget/root_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 Widget* RootView::GetWidget() { | 312 Widget* RootView::GetWidget() { |
| 313 return const_cast<Widget*>(const_cast<const RootView*>(this)->GetWidget()); | 313 return const_cast<Widget*>(const_cast<const RootView*>(this)->GetWidget()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 bool RootView::IsDrawn() const { | 316 bool RootView::IsDrawn() const { |
| 317 return visible(); | 317 return visible(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void RootView::Layout() { | |
| 321 View::Layout(); | |
| 322 widget_->OnRootViewLayout(); | |
| 323 } | |
| 324 | |
| 325 const char* RootView::GetClassName() const { | 320 const char* RootView::GetClassName() const { |
| 326 return kViewClassName; | 321 return kViewClassName; |
| 327 } | 322 } |
| 328 | 323 |
| 329 void RootView::SchedulePaintInRect(const gfx::Rect& rect) { | 324 void RootView::SchedulePaintInRect(const gfx::Rect& rect) { |
| 330 if (layer()) { | 325 if (layer()) { |
| 331 layer()->SchedulePaint(rect); | 326 layer()->SchedulePaint(rect); |
| 332 } else { | 327 } else { |
| 333 gfx::Rect xrect = ConvertRectToParent(rect); | 328 gfx::Rect xrect = ConvertRectToParent(rect); |
| 334 gfx::Rect invalid_rect = gfx::IntersectRects(GetLocalBounds(), xrect); | 329 gfx::Rect invalid_rect = gfx::IntersectRects(GetLocalBounds(), xrect); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 | 752 |
| 758 #ifndef NDEBUG | 753 #ifndef NDEBUG |
| 759 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); | 754 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); |
| 760 #endif | 755 #endif |
| 761 | 756 |
| 762 return details; | 757 return details; |
| 763 } | 758 } |
| 764 | 759 |
| 765 } // namespace internal | 760 } // namespace internal |
| 766 } // namespace views | 761 } // namespace views |
| OLD | NEW |