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

Side by Side Diff: chrome/browser/ui/views/infobars/extension_infobar.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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/infobars/extension_infobar.h" 5 #include "chrome/browser/ui/views/infobars/extension_infobar.h"
6 6
7 #include "chrome/browser/extensions/extension_context_menu_model.h" 7 #include "chrome/browser/extensions/extension_context_menu_model.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" 9 #include "chrome/browser/extensions/extension_infobar_delegate.h"
10 #include "chrome/browser/platform_util.h" 10 #include "chrome/browser/platform_util.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Fall back on the default extension icon on failure. 146 // Fall back on the default extension icon on failure.
147 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 147 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
148 if (!image || image->empty()) 148 if (!image || image->empty())
149 icon = rb.GetBitmapNamed(IDR_EXTENSIONS_SECTION); 149 icon = rb.GetBitmapNamed(IDR_EXTENSIONS_SECTION);
150 150
151 SkBitmap* drop_image = rb.GetBitmapNamed(IDR_APP_DROPARROW); 151 SkBitmap* drop_image = rb.GetBitmapNamed(IDR_APP_DROPARROW);
152 152
153 int image_size = Extension::EXTENSION_ICON_BITTY; 153 int image_size = Extension::EXTENSION_ICON_BITTY;
154 // The margin between the extension icon and the drop-down arrow bitmap. 154 // The margin between the extension icon and the drop-down arrow bitmap.
155 static const int kDropArrowLeftMargin = 3; 155 static const int kDropArrowLeftMargin = 3;
156 scoped_ptr<gfx::CanvasSkia> canvas(new gfx::CanvasSkia( 156 scoped_ptr<gfx::CanvasSkia> canvas(new gfx::CanvasSkia);
157 image_size + kDropArrowLeftMargin + drop_image->width(), image_size, 157 canvas->Init(
158 false)); 158 image_size + kDropArrowLeftMargin + drop_image->width(),
159 image_size,
160 false);
159 canvas->DrawBitmapInt(*icon, 0, 0, icon->width(), icon->height(), 0, 0, 161 canvas->DrawBitmapInt(*icon, 0, 0, icon->width(), icon->height(), 0, 0,
160 image_size, image_size, false); 162 image_size, image_size, false);
161 canvas->DrawBitmapInt(*drop_image, image_size + kDropArrowLeftMargin, 163 canvas->DrawBitmapInt(*drop_image, image_size + kDropArrowLeftMargin,
162 image_size / 2); 164 image_size / 2);
163 menu_->SetIcon(canvas->ExtractBitmap()); 165 menu_->SetIcon(canvas->ExtractBitmap());
164 menu_->SetVisible(true); 166 menu_->SetVisible(true);
165 167
166 Layout(); 168 Layout();
167 } 169 }
168 170
(...skipping 15 matching lines...) Expand all
184 NULL); 186 NULL);
185 } 187 }
186 188
187 options_menu_menu_.reset(new views::Menu2(options_menu_contents_.get())); 189 options_menu_menu_.reset(new views::Menu2(options_menu_contents_.get()));
188 options_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPLEFT); 190 options_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPLEFT);
189 } 191 }
190 192
191 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { 193 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() {
192 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; 194 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL;
193 } 195 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/fullscreen_exit_bubble.cc ('k') | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698