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

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
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() {

Powered by Google App Engine
This is Rietveld 408576698