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/ui/cocoa/renderer_context_menu/render_view_context_menu
_mac.h" | 5 #include "chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu
_mac.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 blink::WebContextMenuData::CheckableMenuItemEnabled; | 324 blink::WebContextMenuData::CheckableMenuItemEnabled; |
325 case IDC_WRITING_DIRECTION_LTR: | 325 case IDC_WRITING_DIRECTION_LTR: |
326 return params_.writing_direction_left_to_right & | 326 return params_.writing_direction_left_to_right & |
327 blink::WebContextMenuData::CheckableMenuItemEnabled; | 327 blink::WebContextMenuData::CheckableMenuItemEnabled; |
328 | 328 |
329 default: | 329 default: |
330 return RenderViewContextMenu::IsCommandIdEnabled(command_id); | 330 return RenderViewContextMenu::IsCommandIdEnabled(command_id); |
331 } | 331 } |
332 } | 332 } |
333 | 333 |
334 bool RenderViewContextMenuMac::GetAcceleratorForCommandId( | |
335 int command_id, | |
336 ui::Accelerator* accelerator) const { | |
337 return false; | |
338 } | |
339 | |
340 void RenderViewContextMenuMac::AppendPlatformEditableItems() { | 334 void RenderViewContextMenuMac::AppendPlatformEditableItems() { |
341 // OS X provides a contextual menu to set writing direction for BiDi | 335 // OS X provides a contextual menu to set writing direction for BiDi |
342 // languages. | 336 // languages. |
343 // This functionality is exposed as a keyboard shortcut on Windows & Linux. | 337 // This functionality is exposed as a keyboard shortcut on Windows & Linux. |
344 AppendBidiSubMenu(); | 338 AppendBidiSubMenu(); |
345 } | 339 } |
346 | 340 |
347 void RenderViewContextMenuMac::InitToolkitMenu() { | 341 void RenderViewContextMenuMac::InitToolkitMenu() { |
348 if (params_.selection_text.empty()) | 342 if (params_.selection_text.empty()) |
349 return; | 343 return; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 if (view) | 432 if (view) |
439 view->SpeakSelection(); | 433 view->SpeakSelection(); |
440 } | 434 } |
441 | 435 |
442 void RenderViewContextMenuMac::StopSpeaking() { | 436 void RenderViewContextMenuMac::StopSpeaking() { |
443 content::RenderWidgetHostView* view = | 437 content::RenderWidgetHostView* view = |
444 GetRenderViewHost()->GetWidget()->GetView(); | 438 GetRenderViewHost()->GetWidget()->GetView(); |
445 if (view) | 439 if (view) |
446 view->StopSpeaking(); | 440 view->StopSpeaking(); |
447 } | 441 } |
OLD | NEW |