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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.h

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 | « chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.h
===================================================================
--- chrome/browser/ui/omnibox/omnibox_edit_model.h (revision 144499)
+++ chrome/browser/ui/omnibox/omnibox_edit_model.h (working copy)
@@ -168,19 +168,14 @@
void StopAutocomplete();
// Determines whether the user can "paste and go", given the specified text.
- // This also updates the internal paste-and-go-related state variables as
- // appropriate so that the controller doesn't need to be repeatedly queried
- // for the same text in every clipboard-related function.
bool CanPasteAndGo(const string16& text) const;
// Navigates to the destination last supplied to CanPasteAndGo.
- void PasteAndGo();
+ void PasteAndGo(const string16& text);
// Returns true if this is a paste-and-search rather than paste-and-go (or
// nothing).
- bool is_paste_and_search() const {
- return (paste_and_go_match_.transition != content::PAGE_TRANSITION_TYPED);
- }
+ bool IsPasteAndSearch(const string16& text) const;
// Asks the browser to load the popup's currently selected item, using the
// supplied disposition. This may close the popup. If |for_drop| is true,
@@ -400,6 +395,12 @@
metrics::OmniboxEventProto::PageClassification ClassifyPage(
const GURL& gurl) const;
+ // Sets |match| and |alternate_nav_url| based on classifying |text|.
+ // |alternate_nav_url| may be NULL.
+ void ClassifyStringForPasteAndGo(const string16& text,
+ AutocompleteMatch* match,
+ GURL* alternate_nav_url) const;
+
scoped_ptr<AutocompleteController> autocomplete_controller_;
OmniboxView* view_;
@@ -494,10 +495,6 @@
// keyword_ to show a "Press <tab> to search" sort of hint.
bool is_keyword_hint_;
- // Paste And Go-related state. See CanPasteAndGo().
- mutable AutocompleteMatch paste_and_go_match_;
- mutable GURL paste_and_go_alternate_nav_url_;
-
Profile* profile_;
// This is needed as prior to accepting the current text the model is
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698