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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm

Issue 10830176: [Mac]: Make dictionary context menu item use system settings for whether to launch Dictionary.app o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 150365)
+++ chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm (working copy)
@@ -192,18 +192,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() {
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698