| 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 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 TemplateURLService* model = | 1787 TemplateURLService* model = |
| 1788 TemplateURLServiceFactory::GetForProfile(GetProfile()); | 1788 TemplateURLServiceFactory::GetForProfile(GetProfile()); |
| 1789 if (!model) | 1789 if (!model) |
| 1790 return; | 1790 return; |
| 1791 model->Load(); | 1791 model->Load(); |
| 1792 | 1792 |
| 1793 SearchEngineTabHelper* search_engine_tab_helper = | 1793 SearchEngineTabHelper* search_engine_tab_helper = |
| 1794 SearchEngineTabHelper::FromWebContents(source_web_contents_); | 1794 SearchEngineTabHelper::FromWebContents(source_web_contents_); |
| 1795 if (search_engine_tab_helper && | 1795 if (search_engine_tab_helper && |
| 1796 search_engine_tab_helper->delegate()) { | 1796 search_engine_tab_helper->delegate()) { |
| 1797 base::string16 keyword(TemplateURL::GenerateKeyword(params_.page_url)); | 1797 base::string16 keyword(TemplateURL::GenerateKeyword( |
| 1798 params_.page_url, |
| 1799 GetProfile()->GetPrefs()->GetString(prefs::kAcceptLanguages))); |
| 1798 TemplateURLData data; | 1800 TemplateURLData data; |
| 1799 data.SetShortName(keyword); | 1801 data.SetShortName(keyword); |
| 1800 data.SetKeyword(keyword); | 1802 data.SetKeyword(keyword); |
| 1801 data.SetURL(params_.keyword_url.spec()); | 1803 data.SetURL(params_.keyword_url.spec()); |
| 1802 data.favicon_url = | 1804 data.favicon_url = |
| 1803 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); | 1805 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); |
| 1804 // Takes ownership of the TemplateURL. | 1806 // Takes ownership of the TemplateURL. |
| 1805 search_engine_tab_helper->delegate()->ConfirmAddSearchProvider( | 1807 search_engine_tab_helper->delegate()->ConfirmAddSearchProvider( |
| 1806 new TemplateURL(data), GetProfile()); | 1808 new TemplateURL(data), GetProfile()); |
| 1807 } | 1809 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 source_web_contents_->GetRenderViewHost()-> | 1920 source_web_contents_->GetRenderViewHost()-> |
| 1919 ExecuteMediaPlayerActionAtLocation(location, action); | 1921 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1920 } | 1922 } |
| 1921 | 1923 |
| 1922 void RenderViewContextMenu::PluginActionAt( | 1924 void RenderViewContextMenu::PluginActionAt( |
| 1923 const gfx::Point& location, | 1925 const gfx::Point& location, |
| 1924 const WebPluginAction& action) { | 1926 const WebPluginAction& action) { |
| 1925 source_web_contents_->GetRenderViewHost()-> | 1927 source_web_contents_->GetRenderViewHost()-> |
| 1926 ExecutePluginActionAtLocation(location, action); | 1928 ExecutePluginActionAtLocation(location, action); |
| 1927 } | 1929 } |
| OLD | NEW |