| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/root_view.h" | 5 #include "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/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 bool RootView::IsVisibleInRootView() const { | 151 bool RootView::IsVisibleInRootView() const { |
| 152 return IsVisible(); | 152 return IsVisible(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 std::string RootView::GetClassName() const { | 155 std::string RootView::GetClassName() const { |
| 156 return kViewClassName; | 156 return kViewClassName; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void RootView::SchedulePaintInRect(const gfx::Rect& rect) { | 159 void RootView::SchedulePaintInRect(const gfx::Rect& rect) { |
| 160 #if defined(COMPOSITOR_2) | |
| 161 MarkTextureDirty(); | 160 MarkTextureDirty(); |
| 162 SchedulePaintInternal(rect); | 161 SchedulePaintInternal(rect); |
| 163 } | 162 } |
| 164 | 163 |
| 165 void RootView::SchedulePaintInternal(const gfx::Rect& rect) { | 164 void RootView::SchedulePaintInternal(const gfx::Rect& rect) { |
| 166 #endif | |
| 167 gfx::Rect xrect = ConvertRectToParent(rect); | 165 gfx::Rect xrect = ConvertRectToParent(rect); |
| 168 gfx::Rect invalid_rect = GetLocalBounds().Intersect(xrect); | 166 gfx::Rect invalid_rect = GetLocalBounds().Intersect(xrect); |
| 169 if (!invalid_rect.IsEmpty()) | 167 if (!invalid_rect.IsEmpty()) |
| 170 widget_->SchedulePaintInRect(invalid_rect); | 168 widget_->SchedulePaintInRect(invalid_rect); |
| 171 } | 169 } |
| 172 | 170 |
| 173 bool RootView::OnMousePressed(const MouseEvent& event) { | 171 bool RootView::OnMousePressed(const MouseEvent& event) { |
| 174 MouseEvent e(event, this); | 172 MouseEvent e(event, this); |
| 175 | 173 |
| 176 UpdateCursor(e); | 174 UpdateCursor(e); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 454 |
| 457 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 455 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
| 458 last_mouse_event_flags_ = event.flags(); | 456 last_mouse_event_flags_ = event.flags(); |
| 459 last_mouse_event_x_ = event.x(); | 457 last_mouse_event_x_ = event.x(); |
| 460 last_mouse_event_y_ = event.y(); | 458 last_mouse_event_y_ = event.y(); |
| 461 } | 459 } |
| 462 | 460 |
| 463 } // namespace internal | 461 } // namespace internal |
| 464 } // namespace views | 462 } // namespace views |
| 465 | 463 |
| OLD | NEW |