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

Side by Side Diff: chrome/browser/ui/views/tabs/dragged_tab_controller.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 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 | Annotate | Revision Log
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_controller.h" 5 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 virtual void OnPaintBackground(gfx::Canvas* canvas) { 78 virtual void OnPaintBackground(gfx::Canvas* canvas) {
79 SkRect outer_rect = { SkIntToScalar(0), SkIntToScalar(0), 79 SkRect outer_rect = { SkIntToScalar(0), SkIntToScalar(0),
80 SkIntToScalar(width()), 80 SkIntToScalar(width()),
81 SkIntToScalar(height()) }; 81 SkIntToScalar(height()) };
82 82
83 // Fill the background rect. 83 // Fill the background rect.
84 SkPaint paint; 84 SkPaint paint;
85 paint.setColor(SkColorSetRGB(108, 108, 108)); 85 paint.setColor(SkColorSetRGB(108, 108, 108));
86 paint.setStyle(SkPaint::kFill_Style); 86 paint.setStyle(SkPaint::kFill_Style);
87 canvas->AsCanvasSkia()->drawRoundRect( 87 canvas->GetSkCanvas()->drawRoundRect(
88 outer_rect, SkIntToScalar(kRoundedRectRadius), 88 outer_rect, SkIntToScalar(kRoundedRectRadius),
89 SkIntToScalar(kRoundedRectRadius), paint); 89 SkIntToScalar(kRoundedRectRadius), paint);
90 90
91 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 91 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
92 92
93 SkBitmap* high_icon = rb.GetBitmapNamed(IDR_DOCK_HIGH); 93 SkBitmap* high_icon = rb.GetBitmapNamed(IDR_DOCK_HIGH);
94 SkBitmap* wide_icon = rb.GetBitmapNamed(IDR_DOCK_WIDE); 94 SkBitmap* wide_icon = rb.GetBitmapNamed(IDR_DOCK_WIDE);
95 95
96 canvas->Save(); 96 canvas->Save();
97 bool rtl_ui = base::i18n::IsRTL(); 97 bool rtl_ui = base::i18n::IsRTL();
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 1446
1447 bool DraggedTabController::AreTabsConsecutive() { 1447 bool DraggedTabController::AreTabsConsecutive() {
1448 for (size_t i = 1; i < drag_data_.size(); ++i) { 1448 for (size_t i = 1; i < drag_data_.size(); ++i) {
1449 if (drag_data_[i - 1].source_model_index + 1 != 1449 if (drag_data_[i - 1].source_model_index + 1 !=
1450 drag_data_[i].source_model_index) { 1450 drag_data_[i].source_model_index) {
1451 return false; 1451 return false;
1452 } 1452 }
1453 } 1453 }
1454 return true; 1454 return true;
1455 } 1455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698