OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string16.h" | 9 #include "base/string16.h" |
10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual void OnAutocompleteLosingFocus( | 43 virtual void OnAutocompleteLosingFocus( |
44 gfx::NativeView view_gaining_focus) = 0; | 44 gfx::NativeView view_gaining_focus) = 0; |
45 | 45 |
46 // Sent prior to OnAutoCompleteAccept and before the model has been reverted. | 46 // Sent prior to OnAutoCompleteAccept and before the model has been reverted. |
47 virtual void OnAutocompleteWillAccept() = 0; | 47 virtual void OnAutocompleteWillAccept() = 0; |
48 | 48 |
49 // Commits the suggested text. |typed_text| is the current text showing in the | 49 // Commits the suggested text. |typed_text| is the current text showing in the |
50 // autocomplete. Returns true if the text was committed. | 50 // autocomplete. Returns true if the text was committed. |
51 virtual bool OnCommitSuggestedText(const std::wstring& typed_text) = 0; | 51 virtual bool OnCommitSuggestedText(const std::wstring& typed_text) = 0; |
52 | 52 |
53 // Accepts the currently showing instant preview, if any, and returns true. | |
54 // Returns false if there is no instant preview showing. | |
55 virtual bool AcceptCurrentInstantPreview() { return false; } | |
56 | |
57 // Sets the suggested search text to |suggested_text|. | 53 // Sets the suggested search text to |suggested_text|. |
58 virtual void OnSetSuggestedSearchText(const string16& suggested_text) = 0; | 54 virtual void OnSetSuggestedSearchText(const string16& suggested_text) = 0; |
59 | 55 |
60 // Invoked when the popup is going to change its bounds to |bounds|. | 56 // Invoked when the popup is going to change its bounds to |bounds|. |
61 virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0; | 57 virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0; |
62 | 58 |
63 // When the user presses enter or selects a line with the mouse, this | 59 // When the user presses enter or selects a line with the mouse, this |
64 // function will get called synchronously with the url to open and | 60 // function will get called synchronously with the url to open and |
65 // disposition and transition to use when opening it. | 61 // disposition and transition to use when opening it. |
66 // | 62 // |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 mutable GURL paste_and_go_url_; | 489 mutable GURL paste_and_go_url_; |
494 mutable PageTransition::Type paste_and_go_transition_; | 490 mutable PageTransition::Type paste_and_go_transition_; |
495 mutable GURL paste_and_go_alternate_nav_url_; | 491 mutable GURL paste_and_go_alternate_nav_url_; |
496 | 492 |
497 Profile* profile_; | 493 Profile* profile_; |
498 | 494 |
499 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 495 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
500 }; | 496 }; |
501 | 497 |
502 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 498 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |