OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "content/browser/frame_host/frame_tree.h" | 11 #include "content/browser/frame_host/frame_tree.h" |
12 #include "content/browser/frame_host/navigator_delegate.h" | 12 #include "content/browser/frame_host/navigator_delegate.h" |
13 #include "content/browser/frame_host/render_frame_host_delegate.h" | 13 #include "content/browser/frame_host/render_frame_host_delegate.h" |
14 #include "content/browser/renderer_host/render_view_host_delegate.h" | 14 #include "content/browser/renderer_host/render_view_host_delegate.h" |
15 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 15 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 16 #include "content/public/browser/dom_operation_notification_details.h" |
16 #include "content/public/browser/interstitial_page.h" | 17 #include "content/public/browser/interstitial_page.h" |
17 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
19 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
20 #include "content/public/common/renderer_preferences.h" | 21 #include "content/public/common/renderer_preferences.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 class NavigationEntry; | 25 class NavigationEntry; |
25 class NavigationControllerImpl; | 26 class NavigationControllerImpl; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 RenderViewHost* render_view_host, | 98 RenderViewHost* render_view_host, |
98 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 99 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
99 | 100 |
100 protected: | 101 protected: |
101 // NotificationObserver method: | 102 // NotificationObserver method: |
102 virtual void Observe(int type, | 103 virtual void Observe(int type, |
103 const NotificationSource& source, | 104 const NotificationSource& source, |
104 const NotificationDetails& details) OVERRIDE; | 105 const NotificationDetails& details) OVERRIDE; |
105 | 106 |
106 // WebContentsObserver implementation: | 107 // WebContentsObserver implementation: |
| 108 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
107 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 109 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; |
108 virtual void NavigationEntryCommitted( | 110 virtual void NavigationEntryCommitted( |
109 const LoadCommittedDetails& load_details) OVERRIDE; | 111 const LoadCommittedDetails& load_details) OVERRIDE; |
110 | 112 |
111 // RenderFrameHostDelegate implementation: | 113 // RenderFrameHostDelegate implementation: |
| 114 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
| 115 const IPC::Message& message) OVERRIDE; |
112 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; | 116 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; |
113 | 117 |
114 // RenderViewHostDelegate implementation: | 118 // RenderViewHostDelegate implementation: |
115 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; | 119 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; |
| 120 virtual bool OnMessageReceived(RenderViewHost* render_view_host, |
| 121 const IPC::Message& message) OVERRIDE; |
116 virtual const GURL& GetURL() const OVERRIDE; | 122 virtual const GURL& GetURL() const OVERRIDE; |
117 virtual void RenderViewTerminated(RenderViewHost* render_view_host, | 123 virtual void RenderViewTerminated(RenderViewHost* render_view_host, |
118 base::TerminationStatus status, | 124 base::TerminationStatus status, |
119 int error_code) OVERRIDE; | 125 int error_code) OVERRIDE; |
120 virtual void UpdateTitle(RenderViewHost* render_view_host, | 126 virtual void UpdateTitle(RenderViewHost* render_view_host, |
121 int32 page_id, | 127 int32 page_id, |
122 const base::string16& title, | 128 const base::string16& title, |
123 base::i18n::TextDirection title_direction) OVERRIDE; | 129 base::i18n::TextDirection title_direction) OVERRIDE; |
124 virtual RendererPreferences GetRendererPrefs( | 130 virtual RendererPreferences GetRendererPrefs( |
125 BrowserContext* browser_context) const OVERRIDE; | 131 BrowserContext* browser_context) const OVERRIDE; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Delete ourselves, causing Shutdown on the RVH to be called. | 193 // Delete ourselves, causing Shutdown on the RVH to be called. |
188 void Shutdown(); | 194 void Shutdown(); |
189 | 195 |
190 void OnNavigatingAwayOrTabClosing(); | 196 void OnNavigatingAwayOrTabClosing(); |
191 | 197 |
192 // Executes the passed action on the ResourceDispatcher (on the IO thread). | 198 // Executes the passed action on the ResourceDispatcher (on the IO thread). |
193 // Used to block/resume/cancel requests for the RenderViewHost hidden by this | 199 // Used to block/resume/cancel requests for the RenderViewHost hidden by this |
194 // interstitial. | 200 // interstitial. |
195 void TakeActionOnResourceDispatcher(ResourceRequestAction action); | 201 void TakeActionOnResourceDispatcher(ResourceRequestAction action); |
196 | 202 |
| 203 // IPC message handlers. |
| 204 void OnDomOperationResponse(const std::string& json_string, |
| 205 int automation_id); |
| 206 |
197 // The contents in which we are displayed. This is valid until Hide is | 207 // The contents in which we are displayed. This is valid until Hide is |
198 // called, at which point it will be set to NULL because the WebContents | 208 // called, at which point it will be set to NULL because the WebContents |
199 // itself may be deleted. | 209 // itself may be deleted. |
200 WebContents* web_contents_; | 210 WebContents* web_contents_; |
201 | 211 |
202 // The NavigationController for the content this page is being displayed over. | 212 // The NavigationController for the content this page is being displayed over. |
203 NavigationControllerImpl* controller_; | 213 NavigationControllerImpl* controller_; |
204 | 214 |
205 // Delegate for dispatching keyboard events and accessing the native view. | 215 // Delegate for dispatching keyboard events and accessing the native view. |
206 RenderWidgetHostDelegate* render_widget_host_delegate_; | 216 RenderWidgetHostDelegate* render_widget_host_delegate_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; | 283 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; |
274 | 284 |
275 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; | 285 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; |
276 | 286 |
277 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); | 287 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); |
278 }; | 288 }; |
279 | 289 |
280 } // namespace content | 290 } // namespace content |
281 | 291 |
282 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ | 292 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ |
OLD | NEW |