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

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: Removed unit test. 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 780da0009d89d73c33a247d33a3baa8616e6b85b..e85c1b580aa46ee895eb4e5f5e28abe875597e9d 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h
@@ -89,12 +89,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_; }
@@ -229,6 +231,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);
@@ -236,7 +241,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).
@@ -274,6 +281,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);
@@ -323,6 +333,7 @@ class OmniboxEditModel {
private:
friend class InstantTestBase;
+ friend class OmniboxControllerTest;
enum PasteState {
NONE, // Most recent edit was not a paste.
@@ -361,9 +372,6 @@ class OmniboxEditModel {
// Returns true if a keyword is selected.
bool KeywordIsSelected() const;
- // Turns off keyword mode for the current match.
- void ClearPopupKeywordMode() const;
-
// 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
// two are different if a keyword is selected.
@@ -381,7 +389,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.
@@ -441,8 +451,6 @@ class OmniboxEditModel {
OmniboxView* view_;
- OmniboxPopupModel* popup_;
-
OmniboxEditController* controller_;
scoped_ptr<OmniboxCurrentPageDelegate> delegate_;

Powered by Google App Engine
This is Rietveld 408576698