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

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

Issue 15003002: Omnibox refactor. Move StartAutocomplete and DoInstant to controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FIxed NIT Created 7 years, 7 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_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_controller.h
diff --git a/chrome/browser/ui/omnibox/omnibox_controller.h b/chrome/browser/ui/omnibox/omnibox_controller.h
index caa1efc8eb78446eaa970fb7aeaa0c24cec05a8c..e210090dd97127bcf5a1d3f88ac7323e4e0f4e5d 100644
--- a/chrome/browser/ui/omnibox/omnibox_controller.h
+++ b/chrome/browser/ui/omnibox/omnibox_controller.h
@@ -8,12 +8,14 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string16.h"
#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
struct AutocompleteMatch;
class AutocompleteResult;
class GURL;
+class InstantController;
class OmniboxEditModel;
class OmniboxPopupModel;
class Profile;
@@ -33,9 +35,16 @@ class Rect;
class OmniboxController : public AutocompleteControllerDelegate {
public:
- OmniboxController(OmniboxEditModel* omnibox_edit_model, Profile* profile);
+ OmniboxController(OmniboxEditModel* omnibox_edit_model,
+ Profile* profile);
virtual ~OmniboxController();
+ void StartAutocomplete(string16 user_text,
+ size_t cursor_position,
+ bool prevent_inline_autocomplete,
+ bool prefer_keyword,
+ bool allow_exact_keyword_match) const;
+
// AutocompleteControllerDelegate:
virtual void OnResultChanged(bool default_match_changed) OVERRIDE;
@@ -43,6 +52,16 @@ class OmniboxController : public AutocompleteControllerDelegate {
return autocomplete_controller_.get();
}
+ bool DoInstant(const AutocompleteMatch& match,
+ string16 user_text,
+ string16 full_text,
+ size_t selection_start,
+ size_t selection_end,
+ bool user_input_in_progress,
+ bool in_escape_handler,
+ bool just_deleted_text,
+ bool keyword_is_selected);
+
void set_popup_model(OmniboxPopupModel* popup_model) {
popup_ = popup_model;
}
@@ -67,6 +86,17 @@ class OmniboxController : public AutocompleteControllerDelegate {
void OnPopupBoundsChanged(const gfx::Rect& bounds);
private:
+
+ // Returns true if a verbatim query should be used for Instant. A verbatim
+ // query is forced in certain situations, such as pressing delete at the end
+ // of the edit.
+ bool UseVerbatimInstant(bool just_deleted_text) const;
+
+ // Access the instant controller from the OmniboxEditModel. We need to do this
+ // because the only valid pointer to InstantController is kept in Browser,
+ // which OmniboxEditModel has some ways of reaching.
+ InstantController* GetInstantController() const;
+
// Weak, it owns us.
// TODO(beaudoin): Consider defining a delegate to ease unit testing.
OmniboxEditModel* omnibox_edit_model_;
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc ('k') | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698