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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu_mac.mm

Issue 5712003: webkit: use string16 in ContextMenuParams (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/tab_contents/render_view_context_menu_mac.h" 5 #include "chrome/browser/tab_contents/render_view_context_menu_mac.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/scoped_nsobject.h" 9 #include "base/scoped_nsobject.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY, 68 IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY,
69 IDS_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY); 69 IDS_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY);
70 } 70 }
71 71
72 } 72 }
73 73
74 void RenderViewContextMenuMac::LookUpInDictionary() { 74 void RenderViewContextMenuMac::LookUpInDictionary() {
75 // TODO(morrita): On Safari, A dictionary panel could be shown 75 // TODO(morrita): On Safari, A dictionary panel could be shown
76 // based on a preference setting of Dictionary.app. We currently 76 // based on a preference setting of Dictionary.app. We currently
77 // don't support it: http://crbug.com/17951 77 // don't support it: http://crbug.com/17951
78 NSString* text = base::SysWideToNSString(params_.selection_text); 78 NSString* text = base::SysUTF16ToNSString(params_.selection_text);
79 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName]; 79 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName];
80 // 10.5 and earlier require declareTypes before setData. 80 // 10.5 and earlier require declareTypes before setData.
81 // See the documentation on [NSPasteboard declareTypes]. 81 // See the documentation on [NSPasteboard declareTypes].
82 NSArray* toDeclare = [NSArray arrayWithObject:NSStringPboardType]; 82 NSArray* toDeclare = [NSArray arrayWithObject:NSStringPboardType];
83 [pboard declareTypes:toDeclare owner:nil]; 83 [pboard declareTypes:toDeclare owner:nil];
84 BOOL ok = [pboard setString:text forType:NSStringPboardType]; 84 BOOL ok = [pboard setString:text forType:NSStringPboardType];
85 if (ok) 85 if (ok)
86 NSPerformService(@"Look Up in Dictionary", pboard); 86 NSPerformService(@"Look Up in Dictionary", pboard);
87 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698