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 |
53 // Sets the suggested search text to |suggested_text|. | 57 // Sets the suggested search text to |suggested_text|. |
54 virtual void OnSetSuggestedSearchText(const string16& suggested_text) = 0; | 58 virtual void OnSetSuggestedSearchText(const string16& suggested_text) = 0; |
55 | 59 |
56 // Invoked when the popup is going to change its bounds to |bounds|. | 60 // Invoked when the popup is going to change its bounds to |bounds|. |
57 virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0; | 61 virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0; |
58 | 62 |
59 // When the user presses enter or selects a line with the mouse, this | 63 // When the user presses enter or selects a line with the mouse, this |
60 // function will get called synchronously with the url to open and | 64 // function will get called synchronously with the url to open and |
61 // disposition and transition to use when opening it. | 65 // disposition and transition to use when opening it. |
62 // | 66 // |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 mutable GURL paste_and_go_url_; | 493 mutable GURL paste_and_go_url_; |
490 mutable PageTransition::Type paste_and_go_transition_; | 494 mutable PageTransition::Type paste_and_go_transition_; |
491 mutable GURL paste_and_go_alternate_nav_url_; | 495 mutable GURL paste_and_go_alternate_nav_url_; |
492 | 496 |
493 Profile* profile_; | 497 Profile* profile_; |
494 | 498 |
495 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 499 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
496 }; | 500 }; |
497 | 501 |
498 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 502 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |