| 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" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool new_navigation, | 54 bool new_navigation, |
| 55 const GURL& url, | 55 const GURL& url, |
| 56 InterstitialPageDelegate* delegate); | 56 InterstitialPageDelegate* delegate); |
| 57 ~InterstitialPageImpl() override; | 57 ~InterstitialPageImpl() override; |
| 58 | 58 |
| 59 // InterstitialPage implementation: | 59 // InterstitialPage implementation: |
| 60 void Show() override; | 60 void Show() override; |
| 61 void Hide() override; | 61 void Hide() override; |
| 62 void DontProceed() override; | 62 void DontProceed() override; |
| 63 void Proceed() override; | 63 void Proceed() override; |
| 64 RenderViewHost* GetRenderViewHostForTesting() const override; | 64 RenderViewHost* GetRenderViewHost() const override; |
| 65 InterstitialPageDelegate* GetDelegateForTesting() override; | 65 InterstitialPageDelegate* GetDelegateForTesting() override; |
| 66 void DontCreateViewForTesting() override; | 66 void DontCreateViewForTesting() override; |
| 67 void SetSize(const gfx::Size& size) override; | 67 void SetSize(const gfx::Size& size) override; |
| 68 void Focus() override; | 68 void Focus() override; |
| 69 | 69 |
| 70 // Allows the user to navigate away by disabling the interstitial, canceling | 70 // Allows the user to navigate away by disabling the interstitial, canceling |
| 71 // the pending request, and unblocking the hidden renderer. The interstitial | 71 // the pending request, and unblocking the hidden renderer. The interstitial |
| 72 // will stay visible until the navigation completes. | 72 // will stay visible until the navigation completes. |
| 73 void CancelForNavigation(); | 73 void CancelForNavigation(); |
| 74 | 74 |
| 75 // Focus the first (last if reverse is true) element in the interstitial page. | 75 // Focus the first (last if reverse is true) element in the interstitial page. |
| 76 // Called when tab traversing. | 76 // Called when tab traversing. |
| 77 void FocusThroughTabTraversal(bool reverse); | 77 void FocusThroughTabTraversal(bool reverse); |
| 78 | 78 |
| 79 RenderWidgetHostView* GetView(); | 79 RenderWidgetHostView* GetView(); |
| 80 | 80 |
| 81 // See description above field. | 81 // See description above field. |
| 82 void set_reload_on_dont_proceed(bool value) { | 82 void set_reload_on_dont_proceed(bool value) { |
| 83 reload_on_dont_proceed_ = value; | 83 reload_on_dont_proceed_ = value; |
| 84 } | 84 } |
| 85 bool reload_on_dont_proceed() const { return reload_on_dont_proceed_; } | 85 bool reload_on_dont_proceed() const { return reload_on_dont_proceed_; } |
| 86 | 86 |
| 87 #if defined(OS_ANDROID) | |
| 88 // Android shares a single platform window for all tabs, so we need to expose | |
| 89 // the RenderViewHost to properly route gestures to the interstitial. | |
| 90 RenderViewHost* GetRenderViewHost() const; | |
| 91 #endif | |
| 92 | |
| 93 // TODO(nasko): This should move to InterstitialPageNavigatorImpl, but in | 87 // TODO(nasko): This should move to InterstitialPageNavigatorImpl, but in |
| 94 // the meantime make it public, so it can be called directly. | 88 // the meantime make it public, so it can be called directly. |
| 95 void DidNavigate( | 89 void DidNavigate( |
| 96 RenderViewHost* render_view_host, | 90 RenderViewHost* render_view_host, |
| 97 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 91 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
| 98 | 92 |
| 99 protected: | 93 protected: |
| 100 // NotificationObserver method: | 94 // NotificationObserver method: |
| 101 void Observe(int type, | 95 void Observe(int type, |
| 102 const NotificationSource& source, | 96 const NotificationSource& source, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; | 288 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; |
| 295 | 289 |
| 296 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; | 290 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; |
| 297 | 291 |
| 298 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); | 292 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); |
| 299 }; | 293 }; |
| 300 | 294 |
| 301 } // namespace content | 295 } // namespace content |
| 302 | 296 |
| 303 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ | 297 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ |
| OLD | NEW |