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

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

Issue 10963042: Switch SearchEngineTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: on the road again Created 8 years, 3 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/ui/browser_adoption.cc » ('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 (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 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 } 1878 }
1879 1879
1880 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { 1880 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: {
1881 // Make sure the model is loaded. 1881 // Make sure the model is loaded.
1882 TemplateURLService* model = 1882 TemplateURLService* model =
1883 TemplateURLServiceFactory::GetForProfile(profile_); 1883 TemplateURLServiceFactory::GetForProfile(profile_);
1884 if (!model) 1884 if (!model)
1885 return; 1885 return;
1886 model->Load(); 1886 model->Load();
1887 1887
1888 TabContents* tab_contents = 1888 SearchEngineTabHelper* search_engine_tab_helper =
1889 TabContents::FromWebContents(source_web_contents_); 1889 SearchEngineTabHelper::FromWebContents(source_web_contents_);
1890 if (tab_contents && 1890 if (search_engine_tab_helper &&
1891 tab_contents->search_engine_tab_helper() && 1891 search_engine_tab_helper->delegate()) {
1892 tab_contents->search_engine_tab_helper()->delegate()) {
1893 string16 keyword(TemplateURLService::GenerateKeyword(params_.page_url)); 1892 string16 keyword(TemplateURLService::GenerateKeyword(params_.page_url));
1894 TemplateURLData data; 1893 TemplateURLData data;
1895 data.short_name = keyword; 1894 data.short_name = keyword;
1896 data.SetKeyword(keyword); 1895 data.SetKeyword(keyword);
1897 data.SetURL(params_.keyword_url.spec()); 1896 data.SetURL(params_.keyword_url.spec());
1898 data.favicon_url = 1897 data.favicon_url =
1899 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); 1898 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin());
1900 // Takes ownership of the TemplateURL. 1899 // Takes ownership of the TemplateURL.
1901 tab_contents->search_engine_tab_helper()->delegate()-> 1900 search_engine_tab_helper->delegate()->
1902 ConfirmAddSearchProvider(new TemplateURL(profile_, data), profile_); 1901 ConfirmAddSearchProvider(new TemplateURL(profile_, data), profile_);
1903 } 1902 }
1904 break; 1903 break;
1905 } 1904 }
1906 1905
1907 #if defined(ENABLE_INPUT_SPEECH) 1906 #if defined(ENABLE_INPUT_SPEECH)
1908 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES: { 1907 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES: {
1909 ChromeSpeechRecognitionPreferences::GetForProfile(profile_)-> 1908 ChromeSpeechRecognitionPreferences::GetForProfile(profile_)->
1910 ToggleFilterProfanities(); 1909 ToggleFilterProfanities();
1911 break; 1910 break;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 source_web_contents_->GetRenderViewHost()-> 2039 source_web_contents_->GetRenderViewHost()->
2041 ExecuteMediaPlayerActionAtLocation(location, action); 2040 ExecuteMediaPlayerActionAtLocation(location, action);
2042 } 2041 }
2043 2042
2044 void RenderViewContextMenu::PluginActionAt( 2043 void RenderViewContextMenu::PluginActionAt(
2045 const gfx::Point& location, 2044 const gfx::Point& location,
2046 const WebPluginAction& action) { 2045 const WebPluginAction& action) {
2047 source_web_contents_->GetRenderViewHost()-> 2046 source_web_contents_->GetRenderViewHost()->
2048 ExecutePluginActionAtLocation(location, action); 2047 ExecutePluginActionAtLocation(location, action);
2049 } 2048 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_adoption.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698