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

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: Reverted dummy test. 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
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..7bb48ee8dd97a36ea834da7ebbd0093404e38674 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,17 @@ class Rect;
class OmniboxController : public AutocompleteControllerDelegate {
public:
- OmniboxController(OmniboxEditModel* omnibox_edit_model, Profile* profile);
+ OmniboxController(OmniboxEditModel* omnibox_edit_model,
+ Profile* profile,
+ InstantController* instant_controller);
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 +53,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 +87,12 @@ 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;
+
// Weak, it owns us.
// TODO(beaudoin): Consider defining a delegate to ease unit testing.
OmniboxEditModel* omnibox_edit_model_;
@@ -75,6 +101,8 @@ class OmniboxController : public AutocompleteControllerDelegate {
OmniboxPopupModel* popup_;
+ InstantController* instant_controller_;
+
scoped_ptr<AutocompleteController> autocomplete_controller_;
DISALLOW_COPY_AND_ASSIGN(OmniboxController);

Powered by Google App Engine
This is Rietveld 408576698