OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 const std::string app_locale = g_browser_process->GetApplicationLocale(); | 682 const std::string app_locale = g_browser_process->GetApplicationLocale(); |
683 l10n_util::SortStrings16(app_locale, &sorted_menu_titles); | 683 l10n_util::SortStrings16(app_locale, &sorted_menu_titles); |
684 sorted_menu_titles.erase( | 684 sorted_menu_titles.erase( |
685 std::unique(sorted_menu_titles.begin(), sorted_menu_titles.end()), | 685 std::unique(sorted_menu_titles.begin(), sorted_menu_titles.end()), |
686 sorted_menu_titles.end()); | 686 sorted_menu_titles.end()); |
687 | 687 |
688 int index = 0; | 688 int index = 0; |
689 for (size_t i = 0; i < sorted_menu_titles.size(); ++i) { | 689 for (size_t i = 0; i < sorted_menu_titles.size(); ++i) { |
690 std::vector<const Extension*>& extensions = | 690 std::vector<const Extension*>& extensions = |
691 title_to_extensions_map[sorted_menu_titles[i]]; | 691 title_to_extensions_map[sorted_menu_titles[i]]; |
692 for (const auto& extension : extensions) { | 692 for (auto* extension : extensions) { |
693 MenuItem::ExtensionKey extension_key(extension->id()); | 693 MenuItem::ExtensionKey extension_key(extension->id()); |
694 extension_items_.AppendExtensionItems(extension_key, | 694 extension_items_.AppendExtensionItems(extension_key, |
695 printable_selection_text, &index, | 695 printable_selection_text, &index, |
696 false); // is_action_menu | 696 false); // is_action_menu |
697 } | 697 } |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 void RenderViewContextMenu::AppendCurrentExtensionItems() { | 701 void RenderViewContextMenu::AppendCurrentExtensionItems() { |
702 // Avoid appending extension related items when |extension| is null. | 702 // Avoid appending extension related items when |extension| is null. |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2438 source_web_contents_->GetRenderViewHost()-> | 2438 source_web_contents_->GetRenderViewHost()-> |
2439 ExecuteMediaPlayerActionAtLocation(location, action); | 2439 ExecuteMediaPlayerActionAtLocation(location, action); |
2440 } | 2440 } |
2441 | 2441 |
2442 void RenderViewContextMenu::PluginActionAt( | 2442 void RenderViewContextMenu::PluginActionAt( |
2443 const gfx::Point& location, | 2443 const gfx::Point& location, |
2444 const WebPluginAction& action) { | 2444 const WebPluginAction& action) { |
2445 source_web_contents_->GetRenderViewHost()-> | 2445 source_web_contents_->GetRenderViewHost()-> |
2446 ExecutePluginActionAtLocation(location, action); | 2446 ExecutePluginActionAtLocation(location, action); |
2447 } | 2447 } |
OLD | NEW |