Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: ui/views/widget/root_view.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/widget/tooltip_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 std::string RootView::GetClassName() const { 185 std::string RootView::GetClassName() const {
186 return kViewClassName; 186 return kViewClassName;
187 } 187 }
188 188
189 void RootView::SchedulePaintInRect(const gfx::Rect& rect) { 189 void RootView::SchedulePaintInRect(const gfx::Rect& rect) {
190 if (layer()) { 190 if (layer()) {
191 layer()->SchedulePaint(rect); 191 layer()->SchedulePaint(rect);
192 } else { 192 } else {
193 gfx::Rect xrect = ConvertRectToParent(rect); 193 gfx::Rect xrect = ConvertRectToParent(rect);
194 gfx::Rect invalid_rect = GetLocalBounds().Intersect(xrect); 194 gfx::Rect invalid_rect = GetLocalBounds();
195 invalid_rect.Intersect(xrect);
195 if (!invalid_rect.IsEmpty()) 196 if (!invalid_rect.IsEmpty())
196 widget_->SchedulePaintInRect(invalid_rect); 197 widget_->SchedulePaintInRect(invalid_rect);
197 } 198 }
198 } 199 }
199 200
200 bool RootView::OnMousePressed(const ui::MouseEvent& event) { 201 bool RootView::OnMousePressed(const ui::MouseEvent& event) {
201 UpdateCursor(event); 202 UpdateCursor(event);
202 SetMouseLocationAndFlags(event); 203 SetMouseLocationAndFlags(event);
203 204
204 // If mouse_pressed_handler_ is non null, we are currently processing 205 // If mouse_pressed_handler_ is non null, we are currently processing
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } 614 }
614 615
615 void RootView::SetMouseLocationAndFlags(const ui::MouseEvent& event) { 616 void RootView::SetMouseLocationAndFlags(const ui::MouseEvent& event) {
616 last_mouse_event_flags_ = event.flags(); 617 last_mouse_event_flags_ = event.flags();
617 last_mouse_event_x_ = event.x(); 618 last_mouse_event_x_ = event.x();
618 last_mouse_event_y_ = event.y(); 619 last_mouse_event_y_ = event.y();
619 } 620 }
620 621
621 } // namespace internal 622 } // namespace internal
622 } // namespace views 623 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/widget/tooltip_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698