| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 item->target_url_patterns()); | 350 item->target_url_patterns()); |
| 351 if (!match) | 351 if (!match) |
| 352 return false; | 352 return false; |
| 353 | 353 |
| 354 const GURL& document_url = GetDocumentURL(params); | 354 const GURL& document_url = GetDocumentURL(params); |
| 355 return ExtensionPatternMatch(item->document_url_patterns(), document_url); | 355 return ExtensionPatternMatch(item->document_url_patterns(), document_url); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void RenderViewContextMenu::AppendAllExtensionItems() { | 358 void RenderViewContextMenu::AppendAllExtensionItems() { |
| 359 extension_items_.Clear(); | 359 extension_items_.Clear(); |
| 360 ExtensionService* service = profile_->GetExtensionService(); | 360 ExtensionService* service = |
| 361 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 361 if (!service) | 362 if (!service) |
| 362 return; // In unit-tests, we may not have an ExtensionService. | 363 return; // In unit-tests, we may not have an ExtensionService. |
| 363 MenuManager* menu_manager = service->menu_manager(); | 364 MenuManager* menu_manager = service->menu_manager(); |
| 364 | 365 |
| 365 // Get a list of extension id's that have context menu items, and sort it by | 366 // Get a list of extension id's that have context menu items, and sort it by |
| 366 // the extension's name. | 367 // the extension's name. |
| 367 std::set<std::string> ids = menu_manager->ExtensionIds(); | 368 std::set<std::string> ids = menu_manager->ExtensionIds(); |
| 368 std::vector<std::pair<std::string, std::string> > sorted_ids; | 369 std::vector<std::pair<std::string, std::string> > sorted_ids; |
| 369 for (std::set<std::string>::iterator i = ids.begin(); i != ids.end(); ++i) { | 370 for (std::set<std::string>::iterator i = ids.begin(); i != ids.end(); ++i) { |
| 370 const Extension* extension = service->GetExtensionById(*i, false); | 371 const Extension* extension = service->GetExtensionById(*i, false); |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 source_web_contents_->GetRenderViewHost()-> | 1857 source_web_contents_->GetRenderViewHost()-> |
| 1857 ExecuteMediaPlayerActionAtLocation(location, action); | 1858 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1858 } | 1859 } |
| 1859 | 1860 |
| 1860 void RenderViewContextMenu::PluginActionAt( | 1861 void RenderViewContextMenu::PluginActionAt( |
| 1861 const gfx::Point& location, | 1862 const gfx::Point& location, |
| 1862 const WebPluginAction& action) { | 1863 const WebPluginAction& action) { |
| 1863 source_web_contents_->GetRenderViewHost()-> | 1864 source_web_contents_->GetRenderViewHost()-> |
| 1864 ExecutePluginActionAtLocation(location, action); | 1865 ExecutePluginActionAtLocation(location, action); |
| 1865 } | 1866 } |
| OLD | NEW |