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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "chrome/common/render_messages.h" | 61 #include "chrome/common/render_messages.h" |
62 #include "chrome/common/spellcheck_messages.h" | 62 #include "chrome/common/spellcheck_messages.h" |
63 #include "chrome/common/url_constants.h" | 63 #include "chrome/common/url_constants.h" |
64 #include "chrome/grit/generated_resources.h" | 64 #include "chrome/grit/generated_resources.h" |
65 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 65 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
66 #include "components/google/core/browser/google_util.h" | 66 #include "components/google/core/browser/google_util.h" |
67 #include "components/metrics/proto/omnibox_input_type.pb.h" | 67 #include "components/metrics/proto/omnibox_input_type.pb.h" |
68 #include "components/omnibox/browser/autocomplete_classifier.h" | 68 #include "components/omnibox/browser/autocomplete_classifier.h" |
69 #include "components/omnibox/browser/autocomplete_match.h" | 69 #include "components/omnibox/browser/autocomplete_match.h" |
70 #include "components/password_manager/core/common/experiments.h" | 70 #include "components/password_manager/core/common/experiments.h" |
| 71 #include "components/search_engines/search_terms_data.h" |
71 #include "components/search_engines/template_url.h" | 72 #include "components/search_engines/template_url.h" |
72 #include "components/search_engines/template_url_service.h" | 73 #include "components/search_engines/template_url_service.h" |
73 #include "components/translate/core/browser/translate_download_manager.h" | 74 #include "components/translate/core/browser/translate_download_manager.h" |
74 #include "components/translate/core/browser/translate_manager.h" | 75 #include "components/translate/core/browser/translate_manager.h" |
75 #include "components/translate/core/browser/translate_prefs.h" | 76 #include "components/translate/core/browser/translate_prefs.h" |
76 #include "components/user_prefs/user_prefs.h" | 77 #include "components/user_prefs/user_prefs.h" |
77 #include "content/public/browser/child_process_security_policy.h" | 78 #include "content/public/browser/child_process_security_policy.h" |
78 #include "content/public/browser/download_manager.h" | 79 #include "content/public/browser/download_manager.h" |
79 #include "content/public/browser/download_save_info.h" | 80 #include "content/public/browser/download_save_info.h" |
80 #include "content/public/browser/download_url_parameters.h" | 81 #include "content/public/browser/download_url_parameters.h" |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 TemplateURLService* model = | 1788 TemplateURLService* model = |
1788 TemplateURLServiceFactory::GetForProfile(GetProfile()); | 1789 TemplateURLServiceFactory::GetForProfile(GetProfile()); |
1789 if (!model) | 1790 if (!model) |
1790 return; | 1791 return; |
1791 model->Load(); | 1792 model->Load(); |
1792 | 1793 |
1793 SearchEngineTabHelper* search_engine_tab_helper = | 1794 SearchEngineTabHelper* search_engine_tab_helper = |
1794 SearchEngineTabHelper::FromWebContents(source_web_contents_); | 1795 SearchEngineTabHelper::FromWebContents(source_web_contents_); |
1795 if (search_engine_tab_helper && | 1796 if (search_engine_tab_helper && |
1796 search_engine_tab_helper->delegate()) { | 1797 search_engine_tab_helper->delegate()) { |
1797 base::string16 keyword(TemplateURL::GenerateKeyword(params_.page_url)); | 1798 base::string16 keyword(TemplateURL::GenerateKeyword( |
| 1799 params_.page_url, |
| 1800 model->search_terms_data().GetAcceptedLanguages())); |
1798 TemplateURLData data; | 1801 TemplateURLData data; |
1799 data.SetShortName(keyword); | 1802 data.SetShortName(keyword); |
1800 data.SetKeyword(keyword); | 1803 data.SetKeyword(keyword); |
1801 data.SetURL(params_.keyword_url.spec()); | 1804 data.SetURL(params_.keyword_url.spec()); |
1802 data.favicon_url = | 1805 data.favicon_url = |
1803 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); | 1806 TemplateURL::GenerateFaviconURL(params_.page_url.GetOrigin()); |
1804 // Takes ownership of the TemplateURL. | 1807 // Takes ownership of the TemplateURL. |
1805 search_engine_tab_helper->delegate()->ConfirmAddSearchProvider( | 1808 search_engine_tab_helper->delegate()->ConfirmAddSearchProvider( |
1806 new TemplateURL(data), GetProfile()); | 1809 new TemplateURL(data), GetProfile()); |
1807 } | 1810 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 source_web_contents_->GetRenderViewHost()-> | 1921 source_web_contents_->GetRenderViewHost()-> |
1919 ExecuteMediaPlayerActionAtLocation(location, action); | 1922 ExecuteMediaPlayerActionAtLocation(location, action); |
1920 } | 1923 } |
1921 | 1924 |
1922 void RenderViewContextMenu::PluginActionAt( | 1925 void RenderViewContextMenu::PluginActionAt( |
1923 const gfx::Point& location, | 1926 const gfx::Point& location, |
1924 const WebPluginAction& action) { | 1927 const WebPluginAction& action) { |
1925 source_web_contents_->GetRenderViewHost()-> | 1928 source_web_contents_->GetRenderViewHost()-> |
1926 ExecutePluginActionAtLocation(location, action); | 1929 ExecutePluginActionAtLocation(location, action); |
1927 } | 1930 } |
OLD | NEW |