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

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

Issue 225263017: Move TranslateManager::IsTranslatableURL to be a client-level concept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" 45 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h"
46 #include "chrome/browser/search/search.h" 46 #include "chrome/browser/search/search.h"
47 #include "chrome/browser/search_engines/search_terms_data.h" 47 #include "chrome/browser/search_engines/search_terms_data.h"
48 #include "chrome/browser/search_engines/template_url.h" 48 #include "chrome/browser/search_engines/template_url.h"
49 #include "chrome/browser/search_engines/template_url_service.h" 49 #include "chrome/browser/search_engines/template_url_service.h"
50 #include "chrome/browser/search_engines/template_url_service_factory.h" 50 #include "chrome/browser/search_engines/template_url_service_factory.h"
51 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" 51 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
52 #include "chrome/browser/spellchecker/spellcheck_service.h" 52 #include "chrome/browser/spellchecker/spellcheck_service.h"
53 #include "chrome/browser/tab_contents/retargeting_details.h" 53 #include "chrome/browser/tab_contents/retargeting_details.h"
54 #include "chrome/browser/translate/translate_manager.h" 54 #include "chrome/browser/translate/translate_manager.h"
55 #include "chrome/browser/translate/translate_service.h"
55 #include "chrome/browser/translate/translate_tab_helper.h" 56 #include "chrome/browser/translate/translate_tab_helper.h"
56 #include "chrome/browser/ui/browser.h" 57 #include "chrome/browser/ui/browser.h"
57 #include "chrome/browser/ui/browser_commands.h" 58 #include "chrome/browser/ui/browser_commands.h"
58 #include "chrome/browser/ui/browser_finder.h" 59 #include "chrome/browser/ui/browser_finder.h"
59 #include "chrome/browser/ui/chrome_pages.h" 60 #include "chrome/browser/ui/chrome_pages.h"
60 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 61 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
61 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 62 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
62 #include "chrome/common/chrome_constants.h" 63 #include "chrome/common/chrome_constants.h"
63 #include "chrome/common/chrome_switches.h" 64 #include "chrome/common/chrome_switches.h"
64 #include "chrome/common/content_restriction.h" 65 #include "chrome/common/content_restriction.h"
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 898
898 void RenderViewContextMenu::AppendPageItems() { 899 void RenderViewContextMenu::AppendPageItems() {
899 menu_model_.AddItemWithStringId(IDC_BACK, IDS_CONTENT_CONTEXT_BACK); 900 menu_model_.AddItemWithStringId(IDC_BACK, IDS_CONTENT_CONTEXT_BACK);
900 menu_model_.AddItemWithStringId(IDC_FORWARD, IDS_CONTENT_CONTEXT_FORWARD); 901 menu_model_.AddItemWithStringId(IDC_FORWARD, IDS_CONTENT_CONTEXT_FORWARD);
901 menu_model_.AddItemWithStringId(IDC_RELOAD, IDS_CONTENT_CONTEXT_RELOAD); 902 menu_model_.AddItemWithStringId(IDC_RELOAD, IDS_CONTENT_CONTEXT_RELOAD);
902 menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); 903 menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
903 menu_model_.AddItemWithStringId(IDC_SAVE_PAGE, 904 menu_model_.AddItemWithStringId(IDC_SAVE_PAGE,
904 IDS_CONTENT_CONTEXT_SAVEPAGEAS); 905 IDS_CONTENT_CONTEXT_SAVEPAGEAS);
905 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); 906 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
906 907
907 if (TranslateManager::IsTranslatableURL(params_.page_url)) { 908 if (TranslateService::IsTranslatableURL(params_.page_url)) {
908 std::string locale = g_browser_process->GetApplicationLocale(); 909 std::string locale = g_browser_process->GetApplicationLocale();
909 locale = TranslateDownloadManager::GetLanguageCode(locale); 910 locale = TranslateDownloadManager::GetLanguageCode(locale);
910 base::string16 language = 911 base::string16 language =
911 l10n_util::GetDisplayNameForLocale(locale, locale, true); 912 l10n_util::GetDisplayNameForLocale(locale, locale, true);
912 menu_model_.AddItem( 913 menu_model_.AddItem(
913 IDC_CONTENT_CONTEXT_TRANSLATE, 914 IDC_CONTENT_CONTEXT_TRANSLATE,
914 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_TRANSLATE, language)); 915 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_TRANSLATE, language));
915 } 916 }
916 917
917 menu_model_.AddItemWithStringId(IDC_VIEW_SOURCE, 918 menu_model_.AddItemWithStringId(IDC_VIEW_SOURCE,
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 source_web_contents_->GetRenderViewHost()-> 2050 source_web_contents_->GetRenderViewHost()->
2050 ExecuteMediaPlayerActionAtLocation(location, action); 2051 ExecuteMediaPlayerActionAtLocation(location, action);
2051 } 2052 }
2052 2053
2053 void RenderViewContextMenu::PluginActionAt( 2054 void RenderViewContextMenu::PluginActionAt(
2054 const gfx::Point& location, 2055 const gfx::Point& location,
2055 const WebPluginAction& action) { 2056 const WebPluginAction& action) {
2056 source_web_contents_->GetRenderViewHost()-> 2057 source_web_contents_->GetRenderViewHost()->
2057 ExecutePluginActionAtLocation(location, action); 2058 ExecutePluginActionAtLocation(location, action);
2058 } 2059 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698