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 #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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 !g_browser_process->local_state()->GetBoolean( | 1198 !g_browser_process->local_state()->GetBoolean( |
1199 prefs::kPrintingEnabled)) { | 1199 prefs::kPrintingEnabled)) { |
1200 return false; | 1200 return false; |
1201 } | 1201 } |
1202 return params_.media_type == WebContextMenuData::MediaTypeNone || | 1202 return params_.media_type == WebContextMenuData::MediaTypeNone || |
1203 params_.media_flags & WebContextMenuData::MediaCanPrint; | 1203 params_.media_flags & WebContextMenuData::MediaCanPrint; |
1204 | 1204 |
1205 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: | 1205 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: |
1206 case IDC_CONTENT_CONTEXT_GOTOURL: | 1206 case IDC_CONTENT_CONTEXT_GOTOURL: |
1207 case IDC_SPELLPANEL_TOGGLE: | 1207 case IDC_SPELLPANEL_TOGGLE: |
1208 #if !defined(OS_MACOSX) | |
1209 // TODO(jeremy): re-enable - http://crbug.com/34512 . | |
1210 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: | 1208 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: |
1211 #endif | |
1212 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: | 1209 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: |
1213 return true; | 1210 return true; |
1214 | 1211 |
1215 case IDC_CHECK_SPELLING_OF_THIS_FIELD: | 1212 case IDC_CHECK_SPELLING_OF_THIS_FIELD: |
1216 return profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck); | 1213 return profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck); |
1217 | 1214 |
1218 #if defined(OS_MACOSX) | 1215 #if defined(OS_MACOSX) |
1219 // TODO(jeremy): re-enable - http://crbug.com/34512 . | |
1220 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: | |
1221 return false; | |
1222 #endif | |
1223 | |
1224 #if defined(OS_MACOSX) | |
1225 case IDC_WRITING_DIRECTION_DEFAULT: // Provided to match OS defaults. | 1216 case IDC_WRITING_DIRECTION_DEFAULT: // Provided to match OS defaults. |
1226 return params_.writing_direction_default & | 1217 return params_.writing_direction_default & |
1227 WebContextMenuData::CheckableMenuItemEnabled; | 1218 WebContextMenuData::CheckableMenuItemEnabled; |
1228 case IDC_WRITING_DIRECTION_RTL: | 1219 case IDC_WRITING_DIRECTION_RTL: |
1229 return params_.writing_direction_right_to_left & | 1220 return params_.writing_direction_right_to_left & |
1230 WebContextMenuData::CheckableMenuItemEnabled; | 1221 WebContextMenuData::CheckableMenuItemEnabled; |
1231 case IDC_WRITING_DIRECTION_LTR: | 1222 case IDC_WRITING_DIRECTION_LTR: |
1232 return params_.writing_direction_left_to_right & | 1223 return params_.writing_direction_left_to_right & |
1233 WebContextMenuData::CheckableMenuItemEnabled; | 1224 WebContextMenuData::CheckableMenuItemEnabled; |
1234 case IDC_WRITING_DIRECTION_MENU: | 1225 case IDC_WRITING_DIRECTION_MENU: |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1828 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1838 g_browser_process->clipboard()); | 1829 g_browser_process->clipboard()); |
1839 } | 1830 } |
1840 | 1831 |
1841 void RenderViewContextMenu::MediaPlayerActionAt( | 1832 void RenderViewContextMenu::MediaPlayerActionAt( |
1842 const gfx::Point& location, | 1833 const gfx::Point& location, |
1843 const WebMediaPlayerAction& action) { | 1834 const WebMediaPlayerAction& action) { |
1844 source_tab_contents_->render_view_host()-> | 1835 source_tab_contents_->render_view_host()-> |
1845 ExecuteMediaPlayerActionAtLocation(location, action); | 1836 ExecuteMediaPlayerActionAtLocation(location, action); |
1846 } | 1837 } |
OLD | NEW |