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

Side by Side Diff: chrome/browser/ui/views/tabs/dragged_tab_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 | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/canvas.h » ('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) 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 "chrome/browser/ui/views/tabs/dragged_tab_view.h" 5 #include "chrome/browser/ui/views/tabs/dragged_tab_view.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" 8 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h"
9 #include "third_party/skia/include/core/SkShader.h" 9 #include "third_party/skia/include/core/SkShader.h"
10 #include "ui/gfx/canvas_skia.h" 10 #include "ui/gfx/canvas_skia.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 SkRect rc; 176 SkRect rc;
177 rc.fLeft = 0; 177 rc.fLeft = 0;
178 rc.fTop = 0; 178 rc.fTop = 0;
179 rc.fRight = SkIntToScalar(ps.width()); 179 rc.fRight = SkIntToScalar(ps.width());
180 rc.fBottom = SkIntToScalar(ps.height()); 180 rc.fBottom = SkIntToScalar(ps.height());
181 canvas->GetSkCanvas()->drawRect(rc, paint); 181 canvas->GetSkCanvas()->drawRect(rc, paint);
182 } 182 }
183 183
184 void DraggedTabView::PaintFocusRect(gfx::Canvas* canvas) { 184 void DraggedTabView::PaintFocusRect(gfx::Canvas* canvas) {
185 gfx::Size ps = GetPreferredSize(); 185 gfx::Size ps = GetPreferredSize();
186 canvas->DrawFocusRect(0, 0, 186 canvas->DrawFocusRect(
187 static_cast<int>(ps.width() * kScalingFactor), 187 gfx::Rect(0, 0,
188 static_cast<int>(ps.height() * kScalingFactor)); 188 static_cast<int>(ps.width() * kScalingFactor),
189 static_cast<int>(ps.height() * kScalingFactor)));
189 } 190 }
190 191
191 gfx::Size DraggedTabView::PreferredContainerSize() { 192 gfx::Size DraggedTabView::PreferredContainerSize() {
192 gfx::Size ps = GetPreferredSize(); 193 gfx::Size ps = GetPreferredSize();
193 return gfx::Size(ScaleValue(ps.width()), ScaleValue(ps.height())); 194 return gfx::Size(ScaleValue(ps.width()), ScaleValue(ps.height()));
194 } 195 }
195 196
196 int DraggedTabView::ScaleValue(int value) { 197 int DraggedTabView::ScaleValue(int value) {
197 return static_cast<int>(value * kScalingFactor); 198 return static_cast<int>(value * kScalingFactor);
198 } 199 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698