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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more two win fixes Created 8 years, 9 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) 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 "chrome/browser/ui/views/browser_actions_container.h" 5 #include "chrome/browser/ui/views/browser_actions_container.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 button_->Destroy(); 326 button_->Destroy();
327 } 327 }
328 328
329 gfx::Canvas* BrowserActionView::GetIconWithBadge() { 329 gfx::Canvas* BrowserActionView::GetIconWithBadge() {
330 int tab_id = panel_->GetCurrentTabId(); 330 int tab_id = panel_->GetCurrentTabId();
331 331
332 SkBitmap icon = button_->extension()->browser_action()->GetIcon(tab_id); 332 SkBitmap icon = button_->extension()->browser_action()->GetIcon(tab_id);
333 if (icon.isNull()) 333 if (icon.isNull())
334 icon = button_->default_icon(); 334 icon = button_->default_icon();
335 335
336 gfx::Canvas* canvas = new gfx::CanvasSkia(icon, false); 336 gfx::Canvas* canvas = new gfx::Canvas(icon, false);
337 337
338 if (tab_id >= 0) { 338 if (tab_id >= 0) {
339 gfx::Rect bounds(icon.width(), icon.height() + ToolbarView::kVertSpacing); 339 gfx::Rect bounds(icon.width(), icon.height() + ToolbarView::kVertSpacing);
340 button_->extension()->browser_action()->PaintBadge(canvas, bounds, tab_id); 340 button_->extension()->browser_action()->PaintBadge(canvas, bounds, tab_id);
341 } 341 }
342 342
343 return canvas; 343 return canvas;
344 } 344 }
345 345
346 void BrowserActionView::Layout() { 346 void BrowserActionView::Layout() {
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 } 1126 }
1127 } 1127 }
1128 1128
1129 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1129 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1130 const Extension* extension) { 1130 const Extension* extension) {
1131 // Only display incognito-enabled extensions while in incognito mode. 1131 // Only display incognito-enabled extensions while in incognito mode.
1132 return 1132 return
1133 (!profile_->IsOffTheRecord() || 1133 (!profile_->IsOffTheRecord() ||
1134 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); 1134 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id()));
1135 } 1135 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/create_application_shortcut_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698