| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // strokes. | 54 // strokes. |
| 55 virtual void StartCapturingKeyStrokes() = 0; | 55 virtual void StartCapturingKeyStrokes() = 0; |
| 56 | 56 |
| 57 // Called when the page wants the browser to stop capturing user key | 57 // Called when the page wants the browser to stop capturing user key |
| 58 // strokes. | 58 // strokes. |
| 59 virtual void StopCapturingKeyStrokes() = 0; | 59 virtual void StopCapturingKeyStrokes() = 0; |
| 60 | 60 |
| 61 // Called when the underlying RenderView crashes. | 61 // Called when the underlying RenderView crashes. |
| 62 virtual void RenderViewGone() = 0; | 62 virtual void RenderViewGone() = 0; |
| 63 | 63 |
| 64 // Called when the page is about to navigate. |
| 65 virtual void AboutToNavigateMainFrame(const GURL& url) = 0; |
| 66 |
| 64 protected: | 67 protected: |
| 65 virtual ~Delegate(); | 68 virtual ~Delegate(); |
| 66 }; | 69 }; |
| 67 | 70 |
| 68 // Doesn't take ownership of |delegate|. | 71 // Doesn't take ownership of |delegate|. |
| 69 explicit InstantClient(Delegate* delegate); | 72 explicit InstantClient(Delegate* delegate); |
| 70 virtual ~InstantClient(); | 73 virtual ~InstantClient(); |
| 71 | 74 |
| 72 // Sets |contents| as the page to communicate with. |contents| can be NULL, | 75 // Sets |contents| as the page to communicate with. |contents| can be NULL, |
| 73 // which effectively stops all communication. | 76 // which effectively stops all communication. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 123 |
| 121 private: | 124 private: |
| 122 // Overridden from content::WebContentsObserver: | 125 // Overridden from content::WebContentsObserver: |
| 123 virtual void DidFinishLoad( | 126 virtual void DidFinishLoad( |
| 124 int64 frame_id, | 127 int64 frame_id, |
| 125 const GURL& validated_url, | 128 const GURL& validated_url, |
| 126 bool is_main_frame, | 129 bool is_main_frame, |
| 127 content::RenderViewHost* render_view_host) OVERRIDE; | 130 content::RenderViewHost* render_view_host) OVERRIDE; |
| 128 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 131 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 129 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 132 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 133 virtual void DidCommitProvisionalLoadForFrame( |
| 134 int64 frame_id, |
| 135 bool is_main_frame, |
| 136 const GURL& url, |
| 137 content::PageTransition transition_type, |
| 138 content::RenderViewHost* render_view_host) OVERRIDE; |
| 130 | 139 |
| 131 void SetSuggestions(int page_id, | 140 void SetSuggestions(int page_id, |
| 132 const std::vector<InstantSuggestion>& suggestions); | 141 const std::vector<InstantSuggestion>& suggestions); |
| 133 void InstantSupportDetermined(int page_id, bool result); | 142 void InstantSupportDetermined(int page_id, bool result); |
| 134 void ShowInstantPreview(int page_id, | 143 void ShowInstantPreview(int page_id, |
| 135 InstantShownReason reason, | 144 InstantShownReason reason, |
| 136 int height, | 145 int height, |
| 137 InstantSizeUnits units); | 146 InstantSizeUnits units); |
| 138 void StartCapturingKeyStrokes(int page_id); | 147 void StartCapturingKeyStrokes(int page_id); |
| 139 void StopCapturingKeyStrokes(int page_id); | 148 void StopCapturingKeyStrokes(int page_id); |
| 140 | 149 |
| 141 Delegate* const delegate_; | 150 Delegate* const delegate_; |
| 142 | 151 |
| 143 DISALLOW_COPY_AND_ASSIGN(InstantClient); | 152 DISALLOW_COPY_AND_ASSIGN(InstantClient); |
| 144 }; | 153 }; |
| 145 | 154 |
| 146 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ | 155 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ |
| OLD | NEW |