| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 7 |
| 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
| 51 #include "chrome/common/print_messages.h" | 51 #include "chrome/common/print_messages.h" |
| 52 #include "chrome/common/spellcheck_messages.h" | 52 #include "chrome/common/spellcheck_messages.h" |
| 53 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
| 54 #include "content/browser/child_process_security_policy.h" | 54 #include "content/browser/child_process_security_policy.h" |
| 55 #include "content/browser/download/download_manager.h" | 55 #include "content/browser/download/download_manager.h" |
| 56 #include "content/browser/download/download_stats.h" | 56 #include "content/browser/download/download_stats.h" |
| 57 #include "content/browser/download/save_package.h" | 57 #include "content/browser/download/save_package.h" |
| 58 #include "content/browser/renderer_host/render_view_host.h" | 58 #include "content/browser/renderer_host/render_view_host.h" |
| 59 #include "content/browser/renderer_host/render_widget_host_view.h" | 59 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 60 #include "content/browser/speech/speech_input_preferences.h" |
| 60 #include "content/browser/tab_contents/navigation_details.h" | 61 #include "content/browser/tab_contents/navigation_details.h" |
| 61 #include "content/browser/tab_contents/navigation_entry.h" | 62 #include "content/browser/tab_contents/navigation_entry.h" |
| 62 #include "content/browser/tab_contents/tab_contents.h" | 63 #include "content/browser/tab_contents/tab_contents.h" |
| 63 #include "content/browser/user_metrics.h" | 64 #include "content/browser/user_metrics.h" |
| 64 #include "content/common/content_restriction.h" | 65 #include "content/common/content_restriction.h" |
| 65 #include "grit/generated_resources.h" | 66 #include "grit/generated_resources.h" |
| 66 #include "net/base/escape.h" | 67 #include "net/base/escape.h" |
| 67 #include "net/base/net_util.h" | 68 #include "net/base/net_util.h" |
| 68 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
| 69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" | 70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 tab_contents_wrapper->search_engine_tab_helper()->delegate()-> | 1823 tab_contents_wrapper->search_engine_tab_helper()->delegate()-> |
| 1823 ConfirmAddSearchProvider(template_url.release(), profile_); | 1824 ConfirmAddSearchProvider(template_url.release(), profile_); |
| 1824 } | 1825 } |
| 1825 break; | 1826 break; |
| 1826 } | 1827 } |
| 1827 | 1828 |
| 1828 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_CENSOR_RESULTS: { | 1829 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_CENSOR_RESULTS: { |
| 1829 PrefService* prefs = profile_->GetPrefs(); | 1830 PrefService* prefs = profile_->GetPrefs(); |
| 1830 const bool censor = !prefs->GetBoolean(prefs::kSpeechInputCensorResults); | 1831 const bool censor = !prefs->GetBoolean(prefs::kSpeechInputCensorResults); |
| 1831 prefs->SetBoolean(prefs::kSpeechInputCensorResults, censor); | 1832 prefs->SetBoolean(prefs::kSpeechInputCensorResults, censor); |
| 1833 profile_->GetSpeechInputPreferences()->set_censor_results(censor); |
| 1832 break; | 1834 break; |
| 1833 } | 1835 } |
| 1834 | 1836 |
| 1835 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_ABOUT: { | 1837 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_ABOUT: { |
| 1836 GURL url(chrome::kSpeechInputAboutURL); | 1838 GURL url(chrome::kSpeechInputAboutURL); |
| 1837 GURL localized_url = google_util::AppendGoogleLocaleParam(url); | 1839 GURL localized_url = google_util::AppendGoogleLocaleParam(url); |
| 1838 // Open URL with no referrer field (because user clicked on menu item). | 1840 // Open URL with no referrer field (because user clicked on menu item). |
| 1839 OpenURL(localized_url, GURL(), 0, NEW_FOREGROUND_TAB, | 1841 OpenURL(localized_url, GURL(), 0, NEW_FOREGROUND_TAB, |
| 1840 PageTransition::LINK); | 1842 PageTransition::LINK); |
| 1841 break; | 1843 break; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1941 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1940 g_browser_process->clipboard()); | 1942 g_browser_process->clipboard()); |
| 1941 } | 1943 } |
| 1942 | 1944 |
| 1943 void RenderViewContextMenu::MediaPlayerActionAt( | 1945 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1944 const gfx::Point& location, | 1946 const gfx::Point& location, |
| 1945 const WebMediaPlayerAction& action) { | 1947 const WebMediaPlayerAction& action) { |
| 1946 source_tab_contents_->render_view_host()-> | 1948 source_tab_contents_->render_view_host()-> |
| 1947 ExecuteMediaPlayerActionAtLocation(location, action); | 1949 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1948 } | 1950 } |
| OLD | NEW |