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

Side by Side Diff: content/public/browser/web_contents_observer.h

Issue 11378008: Raise an infobar and deny access to WebGL if a GPU reset was detected while a web page containing W… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanups after restructuring based on review feedback from @jam. Created 8 years, 1 month 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_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/public/browser/navigation_controller.h" 11 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/common/page_transition_types.h" 12 #include "content/public/common/page_transition_types.h"
13 #include "content/public/common/three_d_api_types.h"
13 #include "ipc/ipc_listener.h" 14 #include "ipc/ipc_listener.h"
14 #include "ipc/ipc_sender.h" 15 #include "ipc/ipc_sender.h"
15 #include "webkit/glue/window_open_disposition.h" 16 #include "webkit/glue/window_open_disposition.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 class RenderViewHost; 20 class RenderViewHost;
20 class WebContents; 21 class WebContents;
21 class WebContentsImpl; 22 class WebContentsImpl;
22 struct FrameNavigateParams; 23 struct FrameNavigateParams;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // with the result. Otherwise it should return false, in which case the next 143 // with the result. Otherwise it should return false, in which case the next
143 // observer will be called. 144 // observer will be called.
144 // Implementations should make sure not to call the callback after the 145 // Implementations should make sure not to call the callback after the
145 // WebContents has been destroyed. 146 // WebContents has been destroyed.
146 virtual bool RequestPpapiBrokerPermission( 147 virtual bool RequestPpapiBrokerPermission(
147 WebContents* web_contents, 148 WebContents* web_contents,
148 const GURL& url, 149 const GURL& url,
149 const FilePath& plugin_path, 150 const FilePath& plugin_path,
150 const base::Callback<void(bool)>& callback); 151 const base::Callback<void(bool)>& callback);
151 152
153 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just
154 // blocked on the current page, specifically because the GPU was
155 // reset recently. If this object handles the request, it should
jam 2012/11/15 16:57:25 nit: just stop this comment at the period. the con
Ken Russell (switch to Gerrit) 2012/11/15 20:53:25 Done.
156 // have the side-effect of raising an infobar to prompt the user
157 // whether they want to run the content (if so, causing the page to
158 // reload).
159 virtual void DidBlock3DAPIs(const GURL& url,
160 ThreeDAPIType requester) {}
161
152 // IPC::Listener implementation. 162 // IPC::Listener implementation.
153 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 163 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
154 164
155 // IPC::Sender implementation. 165 // IPC::Sender implementation.
156 virtual bool Send(IPC::Message* message) OVERRIDE; 166 virtual bool Send(IPC::Message* message) OVERRIDE;
157 int routing_id() const; 167 int routing_id() const;
158 168
159 protected: 169 protected:
160 // Use this constructor when the object is tied to a single WebContents for 170 // Use this constructor when the object is tied to a single WebContents for
161 // its entire lifetime. 171 // its entire lifetime.
(...skipping 19 matching lines...) Expand all
181 void WebContentsImplDestroyed(); 191 void WebContentsImplDestroyed();
182 192
183 WebContentsImpl* web_contents_; 193 WebContentsImpl* web_contents_;
184 194
185 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); 195 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver);
186 }; 196 };
187 197
188 } // namespace content 198 } // namespace content
189 199
190 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 200 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698