| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Called upon determination of Instant API support. Usually in response to | 43 // Called upon determination of Instant API support. Usually in response to |
| 44 // SetContents() or when the page first finishes loading. | 44 // SetContents() or when the page first finishes loading. |
| 45 virtual void InstantSupportDetermined(bool supports_instant) = 0; | 45 virtual void InstantSupportDetermined(bool supports_instant) = 0; |
| 46 | 46 |
| 47 // Called when the page wants to be shown. Usually in response to Change(), | 47 // Called when the page wants to be shown. Usually in response to Change(), |
| 48 // SendAutocompleteResults() or SearchModeChanged(). | 48 // SendAutocompleteResults() or SearchModeChanged(). |
| 49 virtual void ShowInstantPreview(InstantShownReason reason, | 49 virtual void ShowInstantPreview(InstantShownReason reason, |
| 50 int height, | 50 int height, |
| 51 InstantSizeUnits units) = 0; | 51 InstantSizeUnits units) = 0; |
| 52 | 52 |
| 53 // Called when the page wants the browser to start capturing user key |
| 54 // strokes. |
| 55 virtual void StartCapturingKeyStrokes() = 0; |
| 56 |
| 57 // Called when the page wants the browser to stop capturing user key |
| 58 // strokes. |
| 59 virtual void StopCapturingKeyStrokes() = 0; |
| 60 |
| 53 protected: | 61 protected: |
| 54 virtual ~Delegate(); | 62 virtual ~Delegate(); |
| 55 }; | 63 }; |
| 56 | 64 |
| 57 // Doesn't take ownership of |delegate|. | 65 // Doesn't take ownership of |delegate|. |
| 58 explicit InstantClient(Delegate* delegate); | 66 explicit InstantClient(Delegate* delegate); |
| 59 virtual ~InstantClient(); | 67 virtual ~InstantClient(); |
| 60 | 68 |
| 61 // Sets |contents| as the page to communicate with. |contents| can be NULL, | 69 // Sets |contents| as the page to communicate with. |contents| can be NULL, |
| 62 // which effectively stops all communication. | 70 // which effectively stops all communication. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 content::RenderViewHost* render_view_host) OVERRIDE; | 124 content::RenderViewHost* render_view_host) OVERRIDE; |
| 117 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 125 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 118 | 126 |
| 119 void SetSuggestions(int page_id, | 127 void SetSuggestions(int page_id, |
| 120 const std::vector<InstantSuggestion>& suggestions); | 128 const std::vector<InstantSuggestion>& suggestions); |
| 121 void InstantSupportDetermined(int page_id, bool result); | 129 void InstantSupportDetermined(int page_id, bool result); |
| 122 void ShowInstantPreview(int page_id, | 130 void ShowInstantPreview(int page_id, |
| 123 InstantShownReason reason, | 131 InstantShownReason reason, |
| 124 int height, | 132 int height, |
| 125 InstantSizeUnits units); | 133 InstantSizeUnits units); |
| 134 void StartCapturingKeyStrokes(int page_id); |
| 135 void StopCapturingKeyStrokes(int page_id); |
| 126 | 136 |
| 127 Delegate* const delegate_; | 137 Delegate* const delegate_; |
| 128 | 138 |
| 129 DISALLOW_COPY_AND_ASSIGN(InstantClient); | 139 DISALLOW_COPY_AND_ASSIGN(InstantClient); |
| 130 }; | 140 }; |
| 131 | 141 |
| 132 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 142 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |
| OLD | NEW |