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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 10824402: Convert ui::MenuModel to use gfx::Image instead of ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another day, another rebase Created 8 years, 4 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" 9 #include "chrome/browser/tab_contents/render_view_context_menu.h"
10 10
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 ExtensionService* service = profile_->GetExtensionService(); 490 ExtensionService* service = profile_->GetExtensionService();
491 MenuManager* menu_manager = service->menu_manager(); 491 MenuManager* menu_manager = service->menu_manager();
492 492
493 int index = menu_model_.GetItemCount() - 1; 493 int index = menu_model_.GetItemCount() - 1;
494 DCHECK_GE(index, 0); 494 DCHECK_GE(index, 0);
495 495
496 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); 496 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id);
497 DCHECK(icon.width() == gfx::kFaviconSize); 497 DCHECK(icon.width() == gfx::kFaviconSize);
498 DCHECK(icon.height() == gfx::kFaviconSize); 498 DCHECK(icon.height() == gfx::kFaviconSize);
499 499
500 menu_model_.SetIcon(index, icon); 500 menu_model_.SetIcon(index, gfx::Image(icon));
501 } 501 }
502 502
503 void RenderViewContextMenu::AppendAllExtensionItems() { 503 void RenderViewContextMenu::AppendAllExtensionItems() {
504 extension_item_map_.clear(); 504 extension_item_map_.clear();
505 ExtensionService* service = profile_->GetExtensionService(); 505 ExtensionService* service = profile_->GetExtensionService();
506 if (!service) 506 if (!service)
507 return; // In unit-tests, we may not have an ExtensionService. 507 return; // In unit-tests, we may not have an ExtensionService.
508 MenuManager* menu_manager = service->menu_manager(); 508 MenuManager* menu_manager = service->menu_manager();
509 509
510 // Get a list of extension id's that have context menu items, and sort it by 510 // Get a list of extension id's that have context menu items, and sort it by
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 source_web_contents_->GetRenderViewHost()-> 2009 source_web_contents_->GetRenderViewHost()->
2010 ExecuteMediaPlayerActionAtLocation(location, action); 2010 ExecuteMediaPlayerActionAtLocation(location, action);
2011 } 2011 }
2012 2012
2013 void RenderViewContextMenu::PluginActionAt( 2013 void RenderViewContextMenu::PluginActionAt(
2014 const gfx::Point& location, 2014 const gfx::Point& location,
2015 const WebPluginAction& action) { 2015 const WebPluginAction& action) {
2016 source_web_contents_->GetRenderViewHost()-> 2016 source_web_contents_->GetRenderViewHost()->
2017 ExecutePluginActionAtLocation(location, action); 2017 ExecutePluginActionAtLocation(location, action);
2018 } 2018 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chrome/browser/ui/cocoa/menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698