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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 10704074: "Paste and go" state was being calculated wrong on views (at least). Fix by making this calculatio… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
===================================================================
--- chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm (revision 144499)
+++ chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm (working copy)
@@ -942,19 +942,16 @@
}
int OmniboxViewMac::GetPasteActionStringId() {
- DCHECK(CanPasteAndGo());
-
- // Use PASTE_AND_SEARCH as the default fallback (although the DCHECK above
- // should never trigger).
- if (!model_->is_paste_and_search())
- return IDS_PASTE_AND_GO;
- else
- return IDS_PASTE_AND_SEARCH;
+ string16 text(GetClipboardText());
+ DCHECK(model_->CanPasteAndGo(text));
+ return model_->IsPasteAndSearch(GetClipboardText()) ?
+ IDS_PASTE_AND_SEARCH : IDS_PASTE_AND_GO;
}
void OmniboxViewMac::OnPasteAndGo() {
- if (CanPasteAndGo())
- model_->PasteAndGo();
+ string16 text(GetClipboardText());
+ if (model_->CanPasteAndGo(text))
+ model_->PasteAndGo(text);
}
void OmniboxViewMac::OnFrameChanged() {
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698