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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm

Issue 12544034: [Mac] Don't load -pasteAndGo: menu entry which will be bounced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
index 5f2c5316c7a18f9e53aa98920d39df15e06ed64d..be2b8c4ce51cbd9129d99c0193d353bb1f194d3b 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -247,14 +247,16 @@ BOOL ThePasteboardIsTooDamnBig() {
// greyed-out "Paste and Go"?
if ([self isEditable]) {
// Paste and go/search.
- AutocompleteTextFieldObserver* observer = [self observer];
- DCHECK(observer);
- const int string_id = observer->GetPasteActionStringId();
- NSString* label = l10n_util::GetNSStringWithFixup(string_id);
- DCHECK([label length]);
- [menu addItemWithTitle:label
- action:@selector(pasteAndGo:)
- keyEquivalent:@""];
+ if (!ThePasteboardIsTooDamnBig()) {
+ AutocompleteTextFieldObserver* observer = [self observer];
+ DCHECK(observer);
+ const int string_id = observer->GetPasteActionStringId();
+ NSString* label = l10n_util::GetNSStringWithFixup(string_id);
+ DCHECK([label length]);
+ [menu addItemWithTitle:label
+ action:@selector(pasteAndGo:)
+ keyEquivalent:@""];
+ }
NSString* search_engine_label =
l10n_util::GetNSStringWithFixup(IDS_EDIT_SEARCH_ENGINES);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698