Index: chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm (revision 149502) |
+++ chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm (working copy) |
@@ -12,6 +12,8 @@ |
#include "chrome/app/chrome_command_ids.h" |
#import "chrome/browser/ui/cocoa/browser_window_controller.h" |
#import "chrome/browser/ui/cocoa/menu_controller.h" |
+#include "content/public/browser/render_view_host.h" |
+#include "content/public/browser/render_widget_host_view.h" |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -197,18 +199,9 @@ |
} |
void RenderViewContextMenuMac::LookUpInDictionary() { |
- // TODO(morrita): On Safari, A dictionary panel could be shown |
- // based on a preference setting of Dictionary.app. We currently |
- // don't support it: http://crbug.com/17951 |
- NSString* text = base::SysUTF16ToNSString(params_.selection_text); |
- NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName]; |
- // 10.5 and earlier require declareTypes before setData. |
- // See the documentation on [NSPasteboard declareTypes]. |
- NSArray* toDeclare = [NSArray arrayWithObject:NSStringPboardType]; |
- [pboard declareTypes:toDeclare owner:nil]; |
- BOOL ok = [pboard setString:text forType:NSStringPboardType]; |
- if (ok) |
- NSPerformService(@"Look Up in Dictionary", pboard); |
+ content::RenderWidgetHostView* view = GetRenderViewHost()->GetView(); |
+ if (view) |
+ view->ShowDefinitionForSelection(); |
} |
void RenderViewContextMenuMac::StartSpeaking() { |