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

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

Issue 1380833003: Delete IDC_CONTENT_CONTEXT_ADDSEARCHENGINE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | 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/spellchecker/spellcheck_host_metrics.h" 45 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
46 #include "chrome/browser/spellchecker/spellcheck_service.h" 46 #include "chrome/browser/spellchecker/spellcheck_service.h"
47 #include "chrome/browser/ssl/security_state_model.h" 47 #include "chrome/browser/ssl/security_state_model.h"
48 #include "chrome/browser/tab_contents/retargeting_details.h" 48 #include "chrome/browser/tab_contents/retargeting_details.h"
49 #include "chrome/browser/translate/chrome_translate_client.h" 49 #include "chrome/browser/translate/chrome_translate_client.h"
50 #include "chrome/browser/translate/translate_service.h" 50 #include "chrome/browser/translate/translate_service.h"
51 #include "chrome/browser/ui/browser.h" 51 #include "chrome/browser/ui/browser.h"
52 #include "chrome/browser/ui/browser_commands.h" 52 #include "chrome/browser/ui/browser_commands.h"
53 #include "chrome/browser/ui/browser_finder.h" 53 #include "chrome/browser/ui/browser_finder.h"
54 #include "chrome/browser/ui/chrome_pages.h" 54 #include "chrome/browser/ui/chrome_pages.h"
55 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
56 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 55 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
57 #include "chrome/browser/ui/tabs/tab_strip_model.h" 56 #include "chrome/browser/ui/tabs/tab_strip_model.h"
58 #include "chrome/common/chrome_constants.h" 57 #include "chrome/common/chrome_constants.h"
59 #include "chrome/common/chrome_switches.h" 58 #include "chrome/common/chrome_switches.h"
60 #include "chrome/common/content_restriction.h" 59 #include "chrome/common/content_restriction.h"
61 #include "chrome/common/pref_names.h" 60 #include "chrome/common/pref_names.h"
62 #include "chrome/common/render_messages.h" 61 #include "chrome/common/render_messages.h"
63 #include "chrome/common/spellcheck_common.h" 62 #include "chrome/common/spellcheck_common.h"
64 #include "chrome/common/url_constants.h" 63 #include "chrome/common/url_constants.h"
65 #include "chrome/grit/generated_resources.h" 64 #include "chrome/grit/generated_resources.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 {38, -1, IDC_CONTENT_CONTEXT_CUT}, 217 {38, -1, IDC_CONTENT_CONTEXT_CUT},
219 {39, 4, IDC_CONTENT_CONTEXT_COPY}, 218 {39, 4, IDC_CONTENT_CONTEXT_COPY},
220 {40, -1, IDC_CONTENT_CONTEXT_PASTE}, 219 {40, -1, IDC_CONTENT_CONTEXT_PASTE},
221 {41, -1, IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE}, 220 {41, -1, IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE},
222 {42, -1, IDC_CONTENT_CONTEXT_DELETE}, 221 {42, -1, IDC_CONTENT_CONTEXT_DELETE},
223 {43, -1, IDC_CONTENT_CONTEXT_SELECTALL}, 222 {43, -1, IDC_CONTENT_CONTEXT_SELECTALL},
224 {44, 17, IDC_CONTENT_CONTEXT_SEARCHWEBFOR}, 223 {44, 17, IDC_CONTENT_CONTEXT_SEARCHWEBFOR},
225 {45, -1, IDC_CONTENT_CONTEXT_GOTOURL}, 224 {45, -1, IDC_CONTENT_CONTEXT_GOTOURL},
226 {46, -1, IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS}, 225 {46, -1, IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS},
227 {47, -1, IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS}, 226 {47, -1, IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS},
228 {48, -1, IDC_CONTENT_CONTEXT_ADDSEARCHENGINE},
229 {52, -1, IDC_CONTENT_CONTEXT_OPENLINKWITH}, 227 {52, -1, IDC_CONTENT_CONTEXT_OPENLINKWITH},
230 {53, -1, IDC_CHECK_SPELLING_WHILE_TYPING}, 228 {53, -1, IDC_CHECK_SPELLING_WHILE_TYPING},
231 {54, -1, IDC_SPELLCHECK_MENU}, 229 {54, -1, IDC_SPELLCHECK_MENU},
232 {55, -1, IDC_CONTENT_CONTEXT_SPELLING_TOGGLE}, 230 {55, -1, IDC_CONTENT_CONTEXT_SPELLING_TOGGLE},
233 {56, -1, IDC_SPELLCHECK_LANGUAGES_FIRST}, 231 {56, -1, IDC_SPELLCHECK_LANGUAGES_FIRST},
234 {57, 11, IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE}, 232 {57, 11, IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE},
235 {58, -1, IDC_SPELLCHECK_SUGGESTION_0}, 233 {58, -1, IDC_SPELLCHECK_SUGGESTION_0},
236 {59, -1, IDC_SPELLCHECK_ADD_TO_DICTIONARY}, 234 {59, -1, IDC_SPELLCHECK_ADD_TO_DICTIONARY},
237 {60, -1, IDC_SPELLPANEL_TOGGLE}, 235 {60, -1, IDC_SPELLPANEL_TOGGLE},
238 {61, -1, IDC_CONTENT_CONTEXT_OPEN_ORIGINAL_IMAGE_NEW_TAB}, 236 {61, -1, IDC_CONTENT_CONTEXT_OPEN_ORIGINAL_IMAGE_NEW_TAB},
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1376
1379 case IDC_CHECK_SPELLING_WHILE_TYPING: 1377 case IDC_CHECK_SPELLING_WHILE_TYPING:
1380 return prefs->GetBoolean(prefs::kEnableContinuousSpellcheck); 1378 return prefs->GetBoolean(prefs::kEnableContinuousSpellcheck);
1381 1379
1382 #if !defined(OS_MACOSX) && defined(OS_POSIX) 1380 #if !defined(OS_MACOSX) && defined(OS_POSIX)
1383 // TODO(suzhe): this should not be enabled for password fields. 1381 // TODO(suzhe): this should not be enabled for password fields.
1384 case IDC_INPUT_METHODS_MENU: 1382 case IDC_INPUT_METHODS_MENU:
1385 return true; 1383 return true;
1386 #endif 1384 #endif
1387 1385
1388 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE:
1389 return !params_.keyword_url.is_empty();
1390
1391 case IDC_SPELLCHECK_MENU: 1386 case IDC_SPELLCHECK_MENU:
1392 return true; 1387 return true;
1393 1388
1394 case IDC_CONTENT_CONTEXT_OPENLINKWITH: 1389 case IDC_CONTENT_CONTEXT_OPENLINKWITH:
1395 return true; 1390 return true;
1396 1391
1397 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: 1392 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS:
1398 return true; 1393 return true;
1399 1394
1400 case IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD: 1395 case IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD:
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { 1850 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: {
1856 content::RecordAction( 1851 content::RecordAction(
1857 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); 1852 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings"));
1858 WindowOpenDisposition disposition = 1853 WindowOpenDisposition disposition =
1859 ForceNewTabDispositionFromEventFlags(event_flags); 1854 ForceNewTabDispositionFromEventFlags(event_flags);
1860 GURL url = chrome::GetSettingsUrl(chrome::kHandlerSettingsSubPage); 1855 GURL url = chrome::GetSettingsUrl(chrome::kHandlerSettingsSubPage);
1861 OpenURL(url, GURL(), disposition, ui::PAGE_TRANSITION_LINK); 1856 OpenURL(url, GURL(), disposition, ui::PAGE_TRANSITION_LINK);
1862 break; 1857 break;
1863 } 1858 }
1864 1859
1865 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: {
1866 // Make sure the model is loaded.
1867 TemplateURLService* model =
1868 TemplateURLServiceFactory::GetForProfile(GetProfile());
1869 if (!model)
1870 return;
1871 model->Load();
1872
1873 SearchEngineTabHelper* search_engine_tab_helper =
1874 SearchEngineTabHelper::FromWebContents(source_web_contents_);
1875 if (search_engine_tab_helper &&
1876 search_engine_tab_helper->delegate()) {
1877 base::string16 keyword(TemplateURL::GenerateKeyword(
1878 params_.page_url,
1879 GetProfile()->GetPrefs()->GetString(prefs::kAcceptLanguages)));
1880 TemplateURLData data;
1881 data.SetShortName(keyword);
1882 data.SetKeyword(keyword);
1883 data.SetURL(params_.keyword_url.spec());
1884 data.favicon_url =
1885 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin());
1886 // Takes ownership of the TemplateURL.
1887 search_engine_tab_helper->delegate()->ConfirmAddSearchProvider(
1888 new TemplateURL(data), GetProfile());
1889 }
1890 break;
1891 }
1892
1893 case IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD: 1860 case IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD:
1894 ChromePasswordManagerClient::FromWebContents(source_web_contents_)-> 1861 ChromePasswordManagerClient::FromWebContents(source_web_contents_)->
1895 ForceSavePassword(); 1862 ForceSavePassword();
1896 break; 1863 break;
1897 1864
1898 default: 1865 default:
1899 NOTREACHED(); 1866 NOTREACHED();
1900 break; 1867 break;
1901 } 1868 }
1902 } 1869 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 source_web_contents_->GetRenderViewHost()-> 1972 source_web_contents_->GetRenderViewHost()->
2006 ExecuteMediaPlayerActionAtLocation(location, action); 1973 ExecuteMediaPlayerActionAtLocation(location, action);
2007 } 1974 }
2008 1975
2009 void RenderViewContextMenu::PluginActionAt( 1976 void RenderViewContextMenu::PluginActionAt(
2010 const gfx::Point& location, 1977 const gfx::Point& location,
2011 const WebPluginAction& action) { 1978 const WebPluginAction& action) {
2012 source_web_contents_->GetRenderViewHost()-> 1979 source_web_contents_->GetRenderViewHost()->
2013 ExecutePluginActionAtLocation(location, action); 1980 ExecutePluginActionAtLocation(location, action);
2014 } 1981 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698