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

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

Issue 9568002: Renamed speech input implementation from to speech_recognition_*. The namespace has been renamed fr… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "chrome/common/spellcheck_messages.h" 61 #include "chrome/common/spellcheck_messages.h"
62 #include "chrome/common/url_constants.h" 62 #include "chrome/common/url_constants.h"
63 #include "content/browser/download/download_types.h" 63 #include "content/browser/download/download_types.h"
64 #include "content/browser/renderer_host/render_view_host.h" 64 #include "content/browser/renderer_host/render_view_host.h"
65 #include "content/public/browser/child_process_security_policy.h" 65 #include "content/public/browser/child_process_security_policy.h"
66 #include "content/public/browser/download_manager.h" 66 #include "content/public/browser/download_manager.h"
67 #include "content/public/browser/navigation_details.h" 67 #include "content/public/browser/navigation_details.h"
68 #include "content/public/browser/navigation_entry.h" 68 #include "content/public/browser/navigation_entry.h"
69 #include "content/public/browser/notification_service.h" 69 #include "content/public/browser/notification_service.h"
70 #include "content/public/browser/render_widget_host_view.h" 70 #include "content/public/browser/render_widget_host_view.h"
71 #include "content/public/browser/speech_input_preferences.h" 71 #include "content/public/browser/speech_recognition_preferences.h"
72 #include "content/public/browser/user_metrics.h" 72 #include "content/public/browser/user_metrics.h"
73 #include "content/public/browser/web_contents.h" 73 #include "content/public/browser/web_contents.h"
74 #include "content/public/common/content_restriction.h" 74 #include "content/public/common/content_restriction.h"
75 #include "content/public/common/ssl_status.h" 75 #include "content/public/common/ssl_status.h"
76 #include "grit/generated_resources.h" 76 #include "grit/generated_resources.h"
77 #include "net/base/escape.h" 77 #include "net/base/escape.h"
78 #include "net/base/net_util.h" 78 #include "net/base/net_util.h"
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h"
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginAction.h" 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginAction.h"
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 if (id == IDC_WRITING_DIRECTION_LTR) 1401 if (id == IDC_WRITING_DIRECTION_LTR)
1402 return params_.writing_direction_left_to_right & 1402 return params_.writing_direction_left_to_right &
1403 WebContextMenuData::CheckableMenuItemChecked; 1403 WebContextMenuData::CheckableMenuItemChecked;
1404 if (id == IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY) 1404 if (id == IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY)
1405 return false; 1405 return false;
1406 #endif // OS_MACOSX 1406 #endif // OS_MACOSX
1407 1407
1408 // Check box for menu item 'Block offensive words'. 1408 // Check box for menu item 'Block offensive words'.
1409 if (id == IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES) { 1409 if (id == IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES) {
1410 return profile_->GetPrefs()->GetBoolean( 1410 return profile_->GetPrefs()->GetBoolean(
1411 prefs::kSpeechInputFilterProfanities); 1411 prefs::kSpeechRecognitionFilterProfanities);
1412 } 1412 }
1413 1413
1414 return false; 1414 return false;
1415 } 1415 }
1416 1416
1417 void RenderViewContextMenu::ExecuteCommand(int id) { 1417 void RenderViewContextMenu::ExecuteCommand(int id) {
1418 return ExecuteCommand(id, 0); 1418 return ExecuteCommand(id, 0);
1419 } 1419 }
1420 1420
1421 void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { 1421 void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 // Takes ownership of |template_url|. 1837 // Takes ownership of |template_url|.
1838 tab_contents_wrapper->search_engine_tab_helper()->delegate()-> 1838 tab_contents_wrapper->search_engine_tab_helper()->delegate()->
1839 ConfirmAddSearchProvider(template_url.release(), profile_); 1839 ConfirmAddSearchProvider(template_url.release(), profile_);
1840 } 1840 }
1841 break; 1841 break;
1842 } 1842 }
1843 1843
1844 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES: { 1844 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_FILTER_PROFANITIES: {
1845 PrefService* prefs = profile_->GetPrefs(); 1845 PrefService* prefs = profile_->GetPrefs();
1846 const bool filter = !prefs->GetBoolean( 1846 const bool filter = !prefs->GetBoolean(
1847 prefs::kSpeechInputFilterProfanities); 1847 prefs::kSpeechRecognitionFilterProfanities);
1848 prefs->SetBoolean(prefs::kSpeechInputFilterProfanities, filter); 1848 prefs->SetBoolean(prefs::kSpeechRecognitionFilterProfanities, filter);
1849 profile_->GetSpeechInputPreferences()->SetFilterProfanities(filter); 1849 profile_->GetSpeechRecognitionPreferences()->SetFilterProfanities(filter);
1850 break; 1850 break;
1851 } 1851 }
1852 1852
1853 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_ABOUT: { 1853 case IDC_CONTENT_CONTEXT_SPEECH_INPUT_ABOUT: {
1854 GURL url(chrome::kSpeechInputAboutURL); 1854 GURL url(chrome::kSpeechInputAboutURL);
1855 GURL localized_url = google_util::AppendGoogleLocaleParam(url); 1855 GURL localized_url = google_util::AppendGoogleLocaleParam(url);
1856 // Open URL with no referrer field (because user clicked on menu item). 1856 // Open URL with no referrer field (because user clicked on menu item).
1857 OpenURL(localized_url, GURL(), 0, NEW_FOREGROUND_TAB, 1857 OpenURL(localized_url, GURL(), 0, NEW_FOREGROUND_TAB,
1858 content::PAGE_TRANSITION_LINK); 1858 content::PAGE_TRANSITION_LINK);
1859 break; 1859 break;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 source_web_contents_->GetRenderViewHost()-> 1990 source_web_contents_->GetRenderViewHost()->
1991 ExecuteMediaPlayerActionAtLocation(location, action); 1991 ExecuteMediaPlayerActionAtLocation(location, action);
1992 } 1992 }
1993 1993
1994 void RenderViewContextMenu::PluginActionAt( 1994 void RenderViewContextMenu::PluginActionAt(
1995 const gfx::Point& location, 1995 const gfx::Point& location,
1996 const WebPluginAction& action) { 1996 const WebPluginAction& action) {
1997 source_web_contents_->GetRenderViewHost()-> 1997 source_web_contents_->GetRenderViewHost()->
1998 ExecutePluginActionAtLocation(location, action); 1998 ExecutePluginActionAtLocation(location, action);
1999 } 1999 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698