| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 TemplateURLService* model = | 1830 TemplateURLService* model = |
| 1831 TemplateURLServiceFactory::GetForProfile(profile_); | 1831 TemplateURLServiceFactory::GetForProfile(profile_); |
| 1832 if (!model) | 1832 if (!model) |
| 1833 return; | 1833 return; |
| 1834 model->Load(); | 1834 model->Load(); |
| 1835 | 1835 |
| 1836 SearchEngineTabHelper* search_engine_tab_helper = | 1836 SearchEngineTabHelper* search_engine_tab_helper = |
| 1837 SearchEngineTabHelper::FromWebContents(source_web_contents_); | 1837 SearchEngineTabHelper::FromWebContents(source_web_contents_); |
| 1838 if (search_engine_tab_helper && | 1838 if (search_engine_tab_helper && |
| 1839 search_engine_tab_helper->delegate()) { | 1839 search_engine_tab_helper->delegate()) { |
| 1840 base::string16 keyword( | 1840 base::string16 keyword(TemplateURL::GenerateKeyword(params_.page_url)); |
| 1841 TemplateURLService::GenerateKeyword(params_.page_url)); | |
| 1842 TemplateURLData data; | 1841 TemplateURLData data; |
| 1843 data.short_name = keyword; | 1842 data.short_name = keyword; |
| 1844 data.SetKeyword(keyword); | 1843 data.SetKeyword(keyword); |
| 1845 data.SetURL(params_.keyword_url.spec()); | 1844 data.SetURL(params_.keyword_url.spec()); |
| 1846 data.favicon_url = | 1845 data.favicon_url = |
| 1847 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); | 1846 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); |
| 1848 // Takes ownership of the TemplateURL. | 1847 // Takes ownership of the TemplateURL. |
| 1849 search_engine_tab_helper->delegate()-> | 1848 search_engine_tab_helper->delegate()-> |
| 1850 ConfirmAddSearchProvider(new TemplateURL(data), profile_); | 1849 ConfirmAddSearchProvider(new TemplateURL(data), profile_); |
| 1851 } | 1850 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 source_web_contents_->GetRenderViewHost()-> | 1993 source_web_contents_->GetRenderViewHost()-> |
| 1995 ExecuteMediaPlayerActionAtLocation(location, action); | 1994 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1996 } | 1995 } |
| 1997 | 1996 |
| 1998 void RenderViewContextMenu::PluginActionAt( | 1997 void RenderViewContextMenu::PluginActionAt( |
| 1999 const gfx::Point& location, | 1998 const gfx::Point& location, |
| 2000 const WebPluginAction& action) { | 1999 const WebPluginAction& action) { |
| 2001 source_web_contents_->GetRenderViewHost()-> | 2000 source_web_contents_->GetRenderViewHost()-> |
| 2002 ExecutePluginActionAtLocation(location, action); | 2001 ExecutePluginActionAtLocation(location, action); |
| 2003 } | 2002 } |
| OLD | NEW |