Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Side by Side Diff: content/browser/web_contents/interstitial_page_impl.h

Issue 14651029: content: Remove usage of NOTIFICATION_WEB_CONTENTS_DESTROYED from content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo, rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/process_util.h" 11 #include "base/process_util.h"
12 #include "content/browser/renderer_host/render_view_host_delegate.h" 12 #include "content/browser/renderer_host/render_view_host_delegate.h"
13 #include "content/browser/renderer_host/render_widget_host_delegate.h" 13 #include "content/browser/renderer_host/render_widget_host_delegate.h"
14 #include "content/public/browser/interstitial_page.h" 14 #include "content/public/browser/interstitial_page.h"
15 #include "content/public/browser/notification_observer.h" 15 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h" 16 #include "content/public/browser/notification_registrar.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 "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
19 20
20 namespace content { 21 namespace content {
21 class NavigationEntry; 22 class NavigationEntry;
22 class RenderViewHostImpl; 23 class RenderViewHostImpl;
23 class RenderWidgetHostView; 24 class RenderWidgetHostView;
24 class WebContentsView; 25 class WebContentsView;
25 class WebContentsImpl; 26 class WebContentsImpl;
26 27
27 enum ResourceRequestAction { 28 enum ResourceRequestAction {
28 BLOCK, 29 BLOCK,
29 RESUME, 30 RESUME,
30 CANCEL 31 CANCEL
31 }; 32 };
32 33
33 class CONTENT_EXPORT InterstitialPageImpl 34 class CONTENT_EXPORT InterstitialPageImpl
34 : public NON_EXPORTED_BASE(InterstitialPage), 35 : public NON_EXPORTED_BASE(InterstitialPage),
35 public NotificationObserver, 36 public NotificationObserver,
37 public WebContentsObserver,
36 public RenderViewHostDelegate, 38 public RenderViewHostDelegate,
37 public RenderWidgetHostDelegate { 39 public RenderWidgetHostDelegate {
38 public: 40 public:
39 // The different state of actions the user can take in an interstitial. 41 // The different state of actions the user can take in an interstitial.
40 enum ActionState { 42 enum ActionState {
41 NO_ACTION, // No action has been taken yet. 43 NO_ACTION, // No action has been taken yet.
42 PROCEED_ACTION, // "Proceed" was selected. 44 PROCEED_ACTION, // "Proceed" was selected.
43 DONT_PROCEED_ACTION // "Don't proceed" was selected. 45 DONT_PROCEED_ACTION // "Don't proceed" was selected.
44 }; 46 };
45 47
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // the RenderViewHost to properly route gestures to the interstitial. 84 // the RenderViewHost to properly route gestures to the interstitial.
83 RenderViewHost* GetRenderViewHost() const; 85 RenderViewHost* GetRenderViewHost() const;
84 #endif 86 #endif
85 87
86 protected: 88 protected:
87 // NotificationObserver method: 89 // NotificationObserver method:
88 virtual void Observe(int type, 90 virtual void Observe(int type,
89 const NotificationSource& source, 91 const NotificationSource& source,
90 const NotificationDetails& details) OVERRIDE; 92 const NotificationDetails& details) OVERRIDE;
91 93
94 // WebContentsObserver implementation:
95 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
96
92 // RenderViewHostDelegate implementation: 97 // RenderViewHostDelegate implementation:
93 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; 98 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE;
94 virtual const GURL& GetURL() const OVERRIDE; 99 virtual const GURL& GetURL() const OVERRIDE;
95 virtual void RenderViewTerminated(RenderViewHost* render_view_host, 100 virtual void RenderViewTerminated(RenderViewHost* render_view_host,
96 base::TerminationStatus status, 101 base::TerminationStatus status,
97 int error_code) OVERRIDE; 102 int error_code) OVERRIDE;
98 virtual void DidNavigate( 103 virtual void DidNavigate(
99 RenderViewHost* render_view_host, 104 RenderViewHost* render_view_host,
100 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; 105 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;
101 virtual void UpdateTitle(RenderViewHost* render_view_host, 106 virtual void UpdateTitle(RenderViewHost* render_view_host,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 class InterstitialPageRVHDelegateView; 160 class InterstitialPageRVHDelegateView;
156 161
157 // Disable the interstitial: 162 // Disable the interstitial:
158 // - if it is not yet showing, then it won't be shown. 163 // - if it is not yet showing, then it won't be shown.
159 // - any command sent by the RenderViewHost will be ignored. 164 // - any command sent by the RenderViewHost will be ignored.
160 void Disable(); 165 void Disable();
161 166
162 // Shutdown the RVH. We will be deleted by the time this method returns. 167 // Shutdown the RVH. We will be deleted by the time this method returns.
163 void Shutdown(RenderViewHostImpl* render_view_host); 168 void Shutdown(RenderViewHostImpl* render_view_host);
164 169
170 void OnNavigatingAwayOrTabClosing();
171
165 // Executes the passed action on the ResourceDispatcher (on the IO thread). 172 // Executes the passed action on the ResourceDispatcher (on the IO thread).
166 // Used to block/resume/cancel requests for the RenderViewHost hidden by this 173 // Used to block/resume/cancel requests for the RenderViewHost hidden by this
167 // interstitial. 174 // interstitial.
168 void TakeActionOnResourceDispatcher(ResourceRequestAction action); 175 void TakeActionOnResourceDispatcher(ResourceRequestAction action);
169 176
170 // The contents in which we are displayed. This is valid until Hide is 177 // The contents in which we are displayed. This is valid until Hide is
171 // called, at which point it will be set to NULL because the WebContents 178 // called, at which point it will be set to NULL because the WebContents
172 // itself may be deleted. 179 // itself may be deleted.
173 WebContentsImpl* web_contents_; 180 WebContentsImpl* web_contents_;
174 181
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 scoped_ptr<InterstitialPageDelegate> delegate_; 240 scoped_ptr<InterstitialPageDelegate> delegate_;
234 241
235 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_; 242 base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_;
236 243
237 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl); 244 DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl);
238 }; 245 };
239 246
240 } // namespace content 247 } // namespace content
241 248
242 #endif // CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_ 249 #endif // CONTENT_BROWSER_WEB_CONTENTS_INTERSTITIAL_PAGE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698