| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |