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

Side by Side Diff: chrome/browser/extensions/context_menu_matcher.cc

Issue 2576833002: Make some updates to extension iconography. (Closed)
Patch Set: add test Created 4 years 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
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/extensions/context_menu_matcher.h" 5 #include "chrome/browser/extensions/context_menu_matcher.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 return NULL; 302 return NULL;
303 } 303 }
304 304
305 void ContextMenuMatcher::SetExtensionIcon(const std::string& extension_id) { 305 void ContextMenuMatcher::SetExtensionIcon(const std::string& extension_id) {
306 MenuManager* menu_manager = MenuManager::Get(browser_context_); 306 MenuManager* menu_manager = MenuManager::Get(browser_context_);
307 307
308 int index = menu_model_->GetItemCount() - 1; 308 int index = menu_model_->GetItemCount() - 1;
309 DCHECK_GE(index, 0); 309 DCHECK_GE(index, 0);
310 310
311 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); 311 gfx::Image icon = menu_manager->GetIconForExtension(extension_id);
312 DCHECK(icon.width() == gfx::kFaviconSize); 312 DCHECK_EQ(gfx::kFaviconSize, icon.Width());
313 DCHECK(icon.height() == gfx::kFaviconSize); 313 DCHECK_EQ(gfx::kFaviconSize, icon.Height());
314 314 menu_model_->SetIcon(index, icon);
315 menu_model_->SetIcon(index, gfx::Image::CreateFrom1xBitmap(icon));
316 } 315 }
317 316
318 } // namespace extensions 317 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698