OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
9 #include "chrome/common/notification_registrar.h" | 9 #include "chrome/common/notification_registrar.h" |
10 #include "chrome/common/page_transition_types.h" | 10 #include "chrome/common/page_transition_types.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const std::wstring user_text; | 94 const std::wstring user_text; |
95 const std::wstring keyword; | 95 const std::wstring keyword; |
96 const bool is_keyword_hint; | 96 const bool is_keyword_hint; |
97 const KeywordUIState keyword_ui_state; | 97 const KeywordUIState keyword_ui_state; |
98 const bool show_search_hint; | 98 const bool show_search_hint; |
99 }; | 99 }; |
100 | 100 |
101 AutocompleteEditModel(AutocompleteEditView* view, | 101 AutocompleteEditModel(AutocompleteEditView* view, |
102 AutocompleteEditController* controller, | 102 AutocompleteEditController* controller, |
103 Profile* profile); | 103 Profile* profile); |
104 ~AutocompleteEditModel(); | 104 ~AutocompleteEditModel() {} |
105 | 105 |
106 void SetPopupModel(AutocompletePopupModel* popup_model); | 106 void SetPopupModel(AutocompletePopupModel* popup_model); |
107 | 107 |
108 #ifdef UNIT_TEST | 108 #ifdef UNIT_TEST |
109 // It should only be used by testing code. | 109 // It should only be used by testing code. |
110 AutocompletePopupModel* popup_model() const { return popup_; } | 110 AutocompletePopupModel* popup_model() const { return popup_; } |
111 #endif | 111 #endif |
112 | 112 |
113 // Invoked when the profile has changed. | 113 // Invoked when the profile has changed. |
114 void SetProfile(Profile* profile); | 114 void SetProfile(Profile* profile); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // permanent text. If the user has edited the text, this returns the default | 327 // permanent text. If the user has edited the text, this returns the default |
328 // match based on the current text, which may be a search URL, or keyword | 328 // match based on the current text, which may be a search URL, or keyword |
329 // generated URL. | 329 // generated URL. |
330 // | 330 // |
331 // See AutocompleteEdit for a description of the args (they may be null if | 331 // See AutocompleteEdit for a description of the args (they may be null if |
332 // not needed). | 332 // not needed). |
333 GURL GetURLForCurrentText(PageTransition::Type* transition, | 333 GURL GetURLForCurrentText(PageTransition::Type* transition, |
334 bool* is_history_what_you_typed_match, | 334 bool* is_history_what_you_typed_match, |
335 GURL* alternate_nav_url) const; | 335 GURL* alternate_nav_url) const; |
336 | 336 |
337 // Performs a query for only the synchronously available matches for the | |
338 // current input, sets |transition|, |is_history_what_you_typed_match|, and | |
339 // |alternate_nav_url| (if applicable) based on the default match, and returns | |
340 // its url. |transition|, |is_history_what_you_typed_match| and/or | |
341 // |alternate_nav_url| may be null, in which case they are not updated. | |
342 // | |
343 // If there are no matches for the input, leaves the outparams unset and | |
344 // returns the empty string. | |
345 GURL URLsForDefaultMatch(PageTransition::Type* transition, | |
346 bool* is_history_what_you_typed_match, | |
347 GURL* alternate_nav_url) const; | |
348 | |
349 AutocompleteEditView* view_; | 337 AutocompleteEditView* view_; |
350 | 338 |
351 AutocompletePopupModel* popup_; | 339 AutocompletePopupModel* popup_; |
352 | 340 |
353 AutocompleteEditController* controller_; | 341 AutocompleteEditController* controller_; |
354 | 342 |
355 NotificationRegistrar registrar_; | 343 NotificationRegistrar registrar_; |
356 | 344 |
357 // Whether the edit has focus. | 345 // Whether the edit has focus. |
358 bool has_focus_; | 346 bool has_focus_; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 mutable GURL paste_and_go_url_; | 437 mutable GURL paste_and_go_url_; |
450 mutable PageTransition::Type paste_and_go_transition_; | 438 mutable PageTransition::Type paste_and_go_transition_; |
451 mutable GURL paste_and_go_alternate_nav_url_; | 439 mutable GURL paste_and_go_alternate_nav_url_; |
452 | 440 |
453 Profile* profile_; | 441 Profile* profile_; |
454 | 442 |
455 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 443 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
456 }; | 444 }; |
457 | 445 |
458 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 446 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |