OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_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/renderer_host/frame_tree.h" |
11 #include "content/browser/renderer_host/render_view_host_delegate.h" | 12 #include "content/browser/renderer_host/render_view_host_delegate.h" |
12 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 13 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
13 #include "content/public/browser/interstitial_page.h" | 14 #include "content/public/browser/interstitial_page.h" |
14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
17 #include "content/public/common/renderer_preferences.h" | 18 #include "content/public/common/renderer_preferences.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 WindowOpenDisposition disposition, | 125 WindowOpenDisposition disposition, |
125 const gfx::Rect& initial_pos, | 126 const gfx::Rect& initial_pos, |
126 bool user_gesture) OVERRIDE; | 127 bool user_gesture) OVERRIDE; |
127 virtual void ShowCreatedWidget(int route_id, | 128 virtual void ShowCreatedWidget(int route_id, |
128 const gfx::Rect& initial_pos) OVERRIDE; | 129 const gfx::Rect& initial_pos) OVERRIDE; |
129 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; | 130 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; |
130 | 131 |
131 virtual SessionStorageNamespace* GetSessionStorageNamespace( | 132 virtual SessionStorageNamespace* GetSessionStorageNamespace( |
132 SiteInstance* instance) OVERRIDE; | 133 SiteInstance* instance) OVERRIDE; |
133 | 134 |
| 135 virtual FrameTree* GetFrameTree() OVERRIDE; |
| 136 |
134 // RenderWidgetHostDelegate implementation: | 137 // RenderWidgetHostDelegate implementation: |
135 virtual void RenderWidgetDeleted( | 138 virtual void RenderWidgetDeleted( |
136 RenderWidgetHostImpl* render_widget_host) OVERRIDE; | 139 RenderWidgetHostImpl* render_widget_host) OVERRIDE; |
137 virtual bool PreHandleKeyboardEvent( | 140 virtual bool PreHandleKeyboardEvent( |
138 const NativeWebKeyboardEvent& event, | 141 const NativeWebKeyboardEvent& event, |
139 bool* is_keyboard_shortcut) OVERRIDE; | 142 bool* is_keyboard_shortcut) OVERRIDE; |
140 virtual void HandleKeyboardEvent( | 143 virtual void HandleKeyboardEvent( |
141 const NativeWebKeyboardEvent& event) OVERRIDE; | 144 const NativeWebKeyboardEvent& event) OVERRIDE; |
142 #if defined(OS_WIN) && defined(USE_AURA) | 145 #if defined(OS_WIN) && defined(USE_AURA) |
143 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE; | 146 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 bool enabled_; | 207 bool enabled_; |
205 | 208 |
206 // Whether the Proceed or DontProceed methods have been called yet. | 209 // Whether the Proceed or DontProceed methods have been called yet. |
207 ActionState action_taken_; | 210 ActionState action_taken_; |
208 | 211 |
209 // The RenderViewHost displaying the interstitial contents. This is valid | 212 // The RenderViewHost displaying the interstitial contents. This is valid |
210 // until Hide is called, at which point it will be set to NULL, signifying | 213 // until Hide is called, at which point it will be set to NULL, signifying |
211 // that shutdown has started. | 214 // that shutdown has started. |
212 RenderViewHostImpl* render_view_host_; | 215 RenderViewHostImpl* render_view_host_; |
213 | 216 |
| 217 // The frame tree structure of the current page. |
| 218 FrameTree frame_tree_; |
| 219 |
214 // The IDs for the Render[View|Process]Host hidden by this interstitial. | 220 // The IDs for the Render[View|Process]Host hidden by this interstitial. |
215 int original_child_id_; | 221 int original_child_id_; |
216 int original_rvh_id_; | 222 int original_rvh_id_; |
217 | 223 |
218 // Whether or not we should change the title of the contents when hidden (to | 224 // Whether or not we should change the title of the contents when hidden (to |
219 // revert it to its original value). | 225 // revert it to its original value). |
220 bool should_revert_web_contents_title_; | 226 bool should_revert_web_contents_title_; |
221 | 227 |
222 // Whether or not the contents was loading resources when the interstitial was | 228 // Whether or not the contents was loading resources when the interstitial was |
223 // shown. We restore this state if the user proceeds from the interstitial. | 229 // shown. We restore this state if the user proceeds from the interstitial. |
(...skipping 20 matching lines...) Expand all Loading... |
244 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; | 250 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; |
245 | 251 |
246 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; | 252 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; |
247 | 253 |
248 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); | 254 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); |
249 }; | 255 }; |
250 | 256 |
251 } // namespace content | 257 } // namespace content |
252 | 258 |
253 #endif // CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ | 259 #endif // CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ |
OLD | NEW |