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_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 | 10 |
| 11 namespace gfx { |
| 12 class Rect; |
| 13 } |
| 14 |
11 // MatchPreview's delegate. Normally the Browser implements this. See | 15 // MatchPreview's delegate. Normally the Browser implements this. See |
12 // MatchPreview for details. | 16 // MatchPreview for details. |
13 class MatchPreviewDelegate { | 17 class MatchPreviewDelegate { |
14 public: | 18 public: |
15 // Invoked when the preview TabContents should be shown. | 19 // Invoked when the preview TabContents should be shown. |
16 virtual void ShowMatchPreview() = 0; | 20 virtual void ShowMatchPreview() = 0; |
17 | 21 |
18 // Invoked when the preview TabContents should be hidden. | 22 // Invoked when the preview TabContents should be hidden. |
19 virtual void HideMatchPreview() = 0; | 23 virtual void HideMatchPreview() = 0; |
20 | 24 |
21 // Invoked when the user does something that should result in the preview | 25 // Invoked when the user does something that should result in the preview |
22 // TabContents becoming the active TabContents. | 26 // TabContents becoming the active TabContents. |
23 virtual void CommitMatchPreview() = 0; | 27 virtual void CommitMatchPreview() = 0; |
24 | 28 |
25 // Invoked when the suggested text is to change to |text|. | 29 // Invoked when the suggested text is to change to |text|. |
26 virtual void SetSuggestedText(const string16& text) = 0; | 30 virtual void SetSuggestedText(const string16& text) = 0; |
27 | 31 |
| 32 // Returns the bounds the match preview will be placed in, in screen |
| 33 // coordinates. |
| 34 virtual gfx::Rect GetMatchPreviewBounds() = 0; |
| 35 |
28 protected: | 36 protected: |
29 virtual ~MatchPreviewDelegate() {} | 37 virtual ~MatchPreviewDelegate() {} |
30 }; | 38 }; |
31 | 39 |
32 #endif // CHROME_BROWSER_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ | 40 #endif // CHROME_BROWSER_TAB_CONTENTS_MATCH_PREVIEW_DELEGATE_H_ |
OLD | NEW |