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_INSTANT_INSTANT_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/common/instant_types.h" |
10 | 11 |
11 class TabContentsWrapper; | 12 class TabContentsWrapper; |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 class Rect; | 15 class Rect; |
15 } | 16 } |
16 | 17 |
17 // InstantController's delegate. Normally the Browser implements this. See | 18 // InstantController's delegate. Normally the Browser implements this. See |
18 // InstantController for details. | 19 // InstantController for details. |
19 class InstantDelegate { | 20 class InstantDelegate { |
(...skipping 10 matching lines...) Expand all Loading... |
30 // active at the time this is invoked. Use |is_active()| to determine if | 31 // active at the time this is invoked. Use |is_active()| to determine if |
31 // instant is still active. | 32 // instant is still active. |
32 virtual void HideInstant() = 0; | 33 virtual void HideInstant() = 0; |
33 | 34 |
34 // Invoked when the user does something that should result in the preview | 35 // Invoked when the user does something that should result in the preview |
35 // TabContents becoming the active TabContents. The delegate takes ownership | 36 // TabContents becoming the active TabContents. The delegate takes ownership |
36 // of the supplied TabContents. | 37 // of the supplied TabContents. |
37 virtual void CommitInstant(TabContentsWrapper* preview_contents) = 0; | 38 virtual void CommitInstant(TabContentsWrapper* preview_contents) = 0; |
38 | 39 |
39 // Invoked when the suggested text is to change to |text|. | 40 // Invoked when the suggested text is to change to |text|. |
40 virtual void SetSuggestedText(const string16& text) = 0; | 41 virtual void SetSuggestedText(const string16& text, |
| 42 InstantCompleteBehavior behavior) = 0; |
41 | 43 |
42 // Returns the bounds instant will be placed at in screen coordinates. | 44 // Returns the bounds instant will be placed at in screen coordinates. |
43 virtual gfx::Rect GetInstantBounds() = 0; | 45 virtual gfx::Rect GetInstantBounds() = 0; |
44 | 46 |
45 protected: | 47 protected: |
46 virtual ~InstantDelegate() {} | 48 virtual ~InstantDelegate() {} |
47 }; | 49 }; |
48 | 50 |
49 #endif // CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_ | 51 #endif // CHROME_BROWSER_INSTANT_INSTANT_DELEGATE_H_ |
OLD | NEW |