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

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

Issue 14358005: Omnibox refactor, moved OnResultChanged to OmniboxController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_edit_model.h
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.h b/chrome/browser/ui/omnibox/omnibox_edit_model.h
index beda6f033f2aece7bd76874981cb94f2b94141a0..f268205b677f4af0b0ddcb1fd204c3a3d150ba7b 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h
@@ -87,12 +87,14 @@ class OmniboxEditModel {
}
void set_popup_model(OmniboxPopupModel* popup_model) {
- popup_ = popup_model;
+ omnibox_controller_->set_popup_model(popup_model);
}
// TODO: The edit and popup should be siblings owned by the LocationBarView,
// making this accessor unnecessary.
- OmniboxPopupModel* popup_model() const { return popup_; }
+ OmniboxPopupModel* popup_model() const {
+ return omnibox_controller_->popup_model();
+ }
OmniboxEditController* controller() const { return controller_; }
@@ -227,6 +229,9 @@ class OmniboxEditModel {
// used to change user-visible behavior.
bool AcceptKeyword(EnteredKeywordModeMethod entered_method);
+ // Accepts the current temporary text as the user text.
+ void AcceptTemporaryTextAsUserText();
+
// Clears the current keyword. |visible_text| is the (non-keyword) text
// currently visible in the edit.
void ClearKeyword(const string16& visible_text);
@@ -234,7 +239,9 @@ class OmniboxEditModel {
// Returns the current autocomplete result. This logic should in the future
// live in AutocompleteController but resides here for now. This method is
// used by AutomationProvider::AutocompleteEditGetMatches.
- const AutocompleteResult& result() const;
+ const AutocompleteResult& result() const {
+ return omnibox_controller_->result();
+ }
// Called when the view is gaining focus. |control_down| is whether the
// control key is down (at the time we're gaining focus).
@@ -272,6 +279,9 @@ class OmniboxEditModel {
// Returns true if pasting is in progress.
bool is_pasting() const { return paste_state_ == PASTING; }
+ // TODO(beaudoin): Try not to expose this.
+ bool in_revert() const { return in_revert_; }
+
// Called when the user presses up or down. |count| is a repeat count,
// negative for moving up, positive for moving down.
virtual void OnUpOrDownKeyPressed(int count);
@@ -360,7 +370,9 @@ class OmniboxEditModel {
bool KeywordIsSelected() const;
// Turns off keyword mode for the current match.
- void ClearPopupKeywordMode() const;
+ void ClearPopupKeywordMode() const {
+ omnibox_controller_->ClearPopupKeywordMode();
+ }
// Conversion between user text and display text. User text is the text the
// user has input. Display text is the text being shown in the edit. The
@@ -379,7 +391,9 @@ class OmniboxEditModel {
// TODO(pkasting): When manually_selected_match_ moves to the controller, this
// can move too.
void InfoForCurrentSelection(AutocompleteMatch* match,
- GURL* alternate_nav_url) const;
+ GURL* alternate_nav_url) const {
+ omnibox_controller_->InfoForCurrentSelection(match, alternate_nav_url);
+ }
// Returns the default match for the current text, as well as the alternate
// nav URL, if |alternate_nav_url| is non-NULL and there is such a URL.
@@ -439,8 +453,6 @@ class OmniboxEditModel {
OmniboxView* view_;
- OmniboxPopupModel* popup_;
-
OmniboxEditController* controller_;
scoped_ptr<OmniboxCurrentPageDelegate> delegate_;

Powered by Google App Engine
This is Rietveld 408576698