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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 }; | 51 }; |
52 | 52 |
53 InterstitialPageImpl(WebContents* web_contents, | 53 InterstitialPageImpl(WebContents* web_contents, |
54 RenderWidgetHostDelegate* render_widget_host_delegate, | 54 RenderWidgetHostDelegate* render_widget_host_delegate, |
55 bool new_navigation, | 55 bool new_navigation, |
56 const GURL& url, | 56 const GURL& url, |
57 InterstitialPageDelegate* delegate); | 57 InterstitialPageDelegate* delegate); |
58 virtual ~InterstitialPageImpl(); | 58 virtual ~InterstitialPageImpl(); |
59 | 59 |
60 // InterstitialPage implementation: | 60 // InterstitialPage implementation: |
61 virtual void Show() OVERRIDE; | 61 virtual void Show() override; |
62 virtual void Hide() OVERRIDE; | 62 virtual void Hide() override; |
63 virtual void DontProceed() OVERRIDE; | 63 virtual void DontProceed() override; |
64 virtual void Proceed() OVERRIDE; | 64 virtual void Proceed() override; |
65 virtual RenderViewHost* GetRenderViewHostForTesting() const OVERRIDE; | 65 virtual RenderViewHost* GetRenderViewHostForTesting() const override; |
66 virtual InterstitialPageDelegate* GetDelegateForTesting() OVERRIDE; | 66 virtual InterstitialPageDelegate* GetDelegateForTesting() override; |
67 virtual void DontCreateViewForTesting() OVERRIDE; | 67 virtual void DontCreateViewForTesting() override; |
68 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 68 virtual void SetSize(const gfx::Size& size) override; |
69 virtual void Focus() OVERRIDE; | 69 virtual void Focus() override; |
70 | 70 |
71 // Allows the user to navigate away by disabling the interstitial, canceling | 71 // Allows the user to navigate away by disabling the interstitial, canceling |
72 // the pending request, and unblocking the hidden renderer. The interstitial | 72 // the pending request, and unblocking the hidden renderer. The interstitial |
73 // will stay visible until the navigation completes. | 73 // will stay visible until the navigation completes. |
74 void CancelForNavigation(); | 74 void CancelForNavigation(); |
75 | 75 |
76 // Focus the first (last if reverse is true) element in the interstitial page. | 76 // Focus the first (last if reverse is true) element in the interstitial page. |
77 // Called when tab traversing. | 77 // Called when tab traversing. |
78 void FocusThroughTabTraversal(bool reverse); | 78 void FocusThroughTabTraversal(bool reverse); |
79 | 79 |
(...skipping 14 matching lines...) Expand all Loading... |
94 // TODO(nasko): This should move to InterstitialPageNavigatorImpl, but in | 94 // TODO(nasko): This should move to InterstitialPageNavigatorImpl, but in |
95 // the meantime make it public, so it can be called directly. | 95 // the meantime make it public, so it can be called directly. |
96 void DidNavigate( | 96 void DidNavigate( |
97 RenderViewHost* render_view_host, | 97 RenderViewHost* render_view_host, |
98 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 98 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
99 | 99 |
100 protected: | 100 protected: |
101 // NotificationObserver method: | 101 // NotificationObserver method: |
102 virtual void Observe(int type, | 102 virtual void Observe(int type, |
103 const NotificationSource& source, | 103 const NotificationSource& source, |
104 const NotificationDetails& details) OVERRIDE; | 104 const NotificationDetails& details) override; |
105 | 105 |
106 // WebContentsObserver implementation: | 106 // WebContentsObserver implementation: |
107 virtual bool OnMessageReceived(const IPC::Message& message, | 107 virtual bool OnMessageReceived(const IPC::Message& message, |
108 RenderFrameHost* render_frame_host) OVERRIDE; | 108 RenderFrameHost* render_frame_host) override; |
109 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 109 virtual bool OnMessageReceived(const IPC::Message& message) override; |
110 virtual void WebContentsDestroyed() OVERRIDE; | 110 virtual void WebContentsDestroyed() override; |
111 virtual void NavigationEntryCommitted( | 111 virtual void NavigationEntryCommitted( |
112 const LoadCommittedDetails& load_details) OVERRIDE; | 112 const LoadCommittedDetails& load_details) override; |
113 | 113 |
114 // RenderFrameHostDelegate implementation: | 114 // RenderFrameHostDelegate implementation: |
115 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 115 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
116 const IPC::Message& message) OVERRIDE; | 116 const IPC::Message& message) override; |
117 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; | 117 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override; |
118 virtual void UpdateTitle(RenderFrameHost* render_frame_host, | 118 virtual void UpdateTitle(RenderFrameHost* render_frame_host, |
119 int32 page_id, | 119 int32 page_id, |
120 const base::string16& title, | 120 const base::string16& title, |
121 base::i18n::TextDirection title_direction) OVERRIDE; | 121 base::i18n::TextDirection title_direction) override; |
122 virtual AccessibilityMode GetAccessibilityMode() const OVERRIDE; | 122 virtual AccessibilityMode GetAccessibilityMode() const override; |
123 | 123 |
124 // RenderViewHostDelegate implementation: | 124 // RenderViewHostDelegate implementation: |
125 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; | 125 virtual RenderViewHostDelegateView* GetDelegateView() override; |
126 virtual bool OnMessageReceived(RenderViewHost* render_view_host, | 126 virtual bool OnMessageReceived(RenderViewHost* render_view_host, |
127 const IPC::Message& message) OVERRIDE; | 127 const IPC::Message& message) override; |
128 virtual const GURL& GetMainFrameLastCommittedURL() const OVERRIDE; | 128 virtual const GURL& GetMainFrameLastCommittedURL() const override; |
129 virtual void RenderViewTerminated(RenderViewHost* render_view_host, | 129 virtual void RenderViewTerminated(RenderViewHost* render_view_host, |
130 base::TerminationStatus status, | 130 base::TerminationStatus status, |
131 int error_code) OVERRIDE; | 131 int error_code) override; |
132 virtual RendererPreferences GetRendererPrefs( | 132 virtual RendererPreferences GetRendererPrefs( |
133 BrowserContext* browser_context) const OVERRIDE; | 133 BrowserContext* browser_context) const override; |
134 virtual WebPreferences ComputeWebkitPrefs() OVERRIDE; | 134 virtual WebPreferences ComputeWebkitPrefs() override; |
135 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; | 135 virtual gfx::Rect GetRootWindowResizerRect() const override; |
136 virtual void CreateNewWindow( | 136 virtual void CreateNewWindow( |
137 int render_process_id, | 137 int render_process_id, |
138 int route_id, | 138 int route_id, |
139 int main_frame_route_id, | 139 int main_frame_route_id, |
140 const ViewHostMsg_CreateWindow_Params& params, | 140 const ViewHostMsg_CreateWindow_Params& params, |
141 SessionStorageNamespace* session_storage_namespace) OVERRIDE; | 141 SessionStorageNamespace* session_storage_namespace) override; |
142 virtual void CreateNewWidget(int render_process_id, | 142 virtual void CreateNewWidget(int render_process_id, |
143 int route_id, | 143 int route_id, |
144 blink::WebPopupType popup_type) OVERRIDE; | 144 blink::WebPopupType popup_type) override; |
145 virtual void CreateNewFullscreenWidget(int render_process_id, | 145 virtual void CreateNewFullscreenWidget(int render_process_id, |
146 int route_id) OVERRIDE; | 146 int route_id) override; |
147 virtual void ShowCreatedWindow(int route_id, | 147 virtual void ShowCreatedWindow(int route_id, |
148 WindowOpenDisposition disposition, | 148 WindowOpenDisposition disposition, |
149 const gfx::Rect& initial_pos, | 149 const gfx::Rect& initial_pos, |
150 bool user_gesture) OVERRIDE; | 150 bool user_gesture) override; |
151 virtual void ShowCreatedWidget(int route_id, | 151 virtual void ShowCreatedWidget(int route_id, |
152 const gfx::Rect& initial_pos) OVERRIDE; | 152 const gfx::Rect& initial_pos) override; |
153 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; | 153 virtual void ShowCreatedFullscreenWidget(int route_id) override; |
154 | 154 |
155 virtual SessionStorageNamespace* GetSessionStorageNamespace( | 155 virtual SessionStorageNamespace* GetSessionStorageNamespace( |
156 SiteInstance* instance) OVERRIDE; | 156 SiteInstance* instance) override; |
157 | 157 |
158 virtual FrameTree* GetFrameTree() OVERRIDE; | 158 virtual FrameTree* GetFrameTree() override; |
159 | 159 |
160 // RenderWidgetHostDelegate implementation: | 160 // RenderWidgetHostDelegate implementation: |
161 virtual void RenderWidgetDeleted( | 161 virtual void RenderWidgetDeleted( |
162 RenderWidgetHostImpl* render_widget_host) OVERRIDE; | 162 RenderWidgetHostImpl* render_widget_host) override; |
163 virtual bool PreHandleKeyboardEvent( | 163 virtual bool PreHandleKeyboardEvent( |
164 const NativeWebKeyboardEvent& event, | 164 const NativeWebKeyboardEvent& event, |
165 bool* is_keyboard_shortcut) OVERRIDE; | 165 bool* is_keyboard_shortcut) override; |
166 virtual void HandleKeyboardEvent( | 166 virtual void HandleKeyboardEvent( |
167 const NativeWebKeyboardEvent& event) OVERRIDE; | 167 const NativeWebKeyboardEvent& event) override; |
168 #if defined(OS_WIN) | 168 #if defined(OS_WIN) |
169 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() OVERRIDE; | 169 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() override; |
170 #endif | 170 #endif |
171 | 171 |
172 bool enabled() const { return enabled_; } | 172 bool enabled() const { return enabled_; } |
173 WebContents* web_contents() const; | 173 WebContents* web_contents() const; |
174 const GURL& url() const { return url_; } | 174 const GURL& url() const { return url_; } |
175 | 175 |
176 // Creates the RenderViewHost containing the interstitial content. | 176 // Creates the RenderViewHost containing the interstitial content. |
177 // Overriden in unit tests. | 177 // Overriden in unit tests. |
178 virtual RenderViewHost* CreateRenderViewHost(); | 178 virtual RenderViewHost* CreateRenderViewHost(); |
179 | 179 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; | 285 scoped_refptr<SessionStorageNamespace> session_storage_namespace_; |
286 | 286 |
287 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; | 287 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; |
288 | 288 |
289 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); | 289 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); |
290 }; | 290 }; |
291 | 291 |
292 } // namespace content | 292 } // namespace content |
293 | 293 |
294 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ | 294 #endif // CONTENT_BROWSER_FRAME_HOST_INTERSTITIAL_PAGE_IMPL_H_ |
OLD | NEW |