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 "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 Loading... |
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 } |
OLD | NEW |