OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 // TODO: The edit and popup should be siblings owned by the LocationBarView, | 118 // TODO: The edit and popup should be siblings owned by the LocationBarView, |
119 // making this accessor unnecessary. | 119 // making this accessor unnecessary. |
120 AutocompletePopupModel* popup_model() const { return popup_; } | 120 AutocompletePopupModel* popup_model() const { return popup_; } |
121 | 121 |
122 AutocompleteEditController* controller() const { return controller_; } | 122 AutocompleteEditController* controller() const { return controller_; } |
123 | 123 |
124 Profile* profile() const { return profile_; } | 124 Profile* profile() const { return profile_; } |
125 | 125 |
| 126 OmniboxView* view() const { return view_; } |
| 127 |
126 // Returns the current state. This assumes we are switching tabs, and changes | 128 // Returns the current state. This assumes we are switching tabs, and changes |
127 // the internal state appropriately. | 129 // the internal state appropriately. |
128 const State GetStateForTabSwitch(); | 130 const State GetStateForTabSwitch(); |
129 | 131 |
130 // Restores local state from the saved |state|. | 132 // Restores local state from the saved |state|. |
131 void RestoreState(const State& state); | 133 void RestoreState(const State& state); |
132 | 134 |
133 // Returns the match for the current text. If the user has not edited the text | 135 // Returns the match for the current text. If the user has not edited the text |
134 // this is the match corresponding to the permanent text. | 136 // this is the match corresponding to the permanent text. |
135 AutocompleteMatch CurrentMatch(); | 137 AutocompleteMatch CurrentMatch(); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // AutocompleteController but resides here for now. This method is used by | 374 // AutocompleteController but resides here for now. This method is used by |
373 // AutomationProvider::AutocompleteEditIsQueryInProgress. | 375 // AutomationProvider::AutocompleteEditIsQueryInProgress. |
374 bool query_in_progress() const; | 376 bool query_in_progress() const; |
375 | 377 |
376 // Called whenever user_text_ should change. | 378 // Called whenever user_text_ should change. |
377 void InternalSetUserText(const string16& text); | 379 void InternalSetUserText(const string16& text); |
378 | 380 |
379 // Returns true if a keyword is selected. | 381 // Returns true if a keyword is selected. |
380 bool KeywordIsSelected() const; | 382 bool KeywordIsSelected() const; |
381 | 383 |
| 384 // Turns off keyword mode for the current match. |
| 385 void ClearPopupKeywordMode() const; |
| 386 |
382 // Conversion between user text and display text. User text is the text the | 387 // Conversion between user text and display text. User text is the text the |
383 // user has input. Display text is the text being shown in the edit. The | 388 // user has input. Display text is the text being shown in the edit. The |
384 // two are different if a keyword is selected. | 389 // two are different if a keyword is selected. |
385 string16 DisplayTextFromUserText(const string16& text) const; | 390 string16 DisplayTextFromUserText(const string16& text) const; |
386 string16 UserTextFromDisplayText(const string16& text) const; | 391 string16 UserTextFromDisplayText(const string16& text) const; |
387 | 392 |
388 // Copies the selected match into |match|. If an update is in progress, | 393 // Copies the selected match into |match|. If an update is in progress, |
389 // "selected" means "default in the latest matches". If there are no matches, | 394 // "selected" means "default in the latest matches". If there are no matches, |
390 // does not update |match|. | 395 // does not update |match|. |
391 // | 396 // |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. | 560 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. |
556 InstantCompleteBehavior instant_complete_behavior_; | 561 InstantCompleteBehavior instant_complete_behavior_; |
557 | 562 |
558 // Used to determine what network actions to take in different circumstances. | 563 // Used to determine what network actions to take in different circumstances. |
559 NetworkActionPredictor network_action_predictor_; | 564 NetworkActionPredictor network_action_predictor_; |
560 | 565 |
561 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 566 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
562 }; | 567 }; |
563 | 568 |
564 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 569 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |