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

Side by Side Diff: views/view.cc

Issue 8359029: ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « views/controls/label.cc ('k') | no next file » | 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) 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/view.h" 5 #include "views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 gfx::Rect contents_bounds(GetLocalBounds()); 292 gfx::Rect contents_bounds(GetLocalBounds());
293 if (border_.get()) { 293 if (border_.get()) {
294 gfx::Insets insets; 294 gfx::Insets insets;
295 border_->GetInsets(&insets); 295 border_->GetInsets(&insets);
296 contents_bounds.Inset(insets); 296 contents_bounds.Inset(insets);
297 } 297 }
298 return contents_bounds; 298 return contents_bounds;
299 } 299 }
300 300
301 gfx::Rect View::GetLocalBounds() const { 301 gfx::Rect View::GetLocalBounds() const {
302 return gfx::Rect(0, 0, width(), height()); 302 return gfx::Rect(gfx::Point(), size());
303 } 303 }
304 304
305 gfx::Insets View::GetInsets() const { 305 gfx::Insets View::GetInsets() const {
306 gfx::Insets insets; 306 gfx::Insets insets;
307 if (border_.get()) 307 if (border_.get())
308 border_->GetInsets(&insets); 308 border_->GetInsets(&insets);
309 return insets; 309 return insets;
310 } 310 }
311 311
312 gfx::Rect View::GetVisibleBounds() const { 312 gfx::Rect View::GetVisibleBounds() const {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 background_->Paint(canvas, this); 1072 background_->Paint(canvas, this);
1073 } 1073 }
1074 1074
1075 void View::OnPaintBorder(gfx::Canvas* canvas) { 1075 void View::OnPaintBorder(gfx::Canvas* canvas) {
1076 if (border_.get()) 1076 if (border_.get())
1077 border_->Paint(*this, canvas); 1077 border_->Paint(*this, canvas);
1078 } 1078 }
1079 1079
1080 void View::OnPaintFocusBorder(gfx::Canvas* canvas) { 1080 void View::OnPaintFocusBorder(gfx::Canvas* canvas) {
1081 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) 1081 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus())
1082 canvas->DrawFocusRect(0, 0, width(), height()); 1082 canvas->DrawFocusRect(GetLocalBounds());
1083 } 1083 }
1084 1084
1085 // Accelerated Painting -------------------------------------------------------- 1085 // Accelerated Painting --------------------------------------------------------
1086 1086
1087 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { 1087 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) {
1088 // This method should not have the side-effect of creating the layer. 1088 // This method should not have the side-effect of creating the layer.
1089 if (layer()) 1089 if (layer())
1090 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); 1090 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely);
1091 } 1091 }
1092 1092
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 2075
2076 OSExchangeData data; 2076 OSExchangeData data;
2077 WriteDragData(press_pt, &data); 2077 WriteDragData(press_pt, &data);
2078 2078
2079 // Message the RootView to do the drag and drop. That way if we're removed 2079 // Message the RootView to do the drag and drop. That way if we're removed
2080 // the RootView can detect it and avoid calling us back. 2080 // the RootView can detect it and avoid calling us back.
2081 GetWidget()->RunShellDrag(this, data, drag_operations); 2081 GetWidget()->RunShellDrag(this, data, drag_operations);
2082 } 2082 }
2083 2083
2084 } // namespace views 2084 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698