| 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_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" | |
| 9 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 10 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| 12 #include "content/public/common/page_transition_types.h" | 11 #include "content/public/common/page_transition_types.h" |
| 13 #include "content/public/common/three_d_api_types.h" | 12 #include "content/public/common/three_d_api_types.h" |
| 14 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
| 15 #include "ipc/ipc_sender.h" | 14 #include "ipc/ipc_sender.h" |
| 16 #include "webkit/glue/window_open_disposition.h" | 15 #include "webkit/glue/window_open_disposition.h" |
| 17 | 16 |
| 18 namespace content { | 17 namespace content { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 WebContents* new_web_contents) {} | 130 WebContents* new_web_contents) {} |
| 132 | 131 |
| 133 // Invoked when the WebContents is being destroyed. Gives subclasses a chance | 132 // Invoked when the WebContents is being destroyed. Gives subclasses a chance |
| 134 // to cleanup. At the time this is invoked |web_contents()| returns NULL. | 133 // to cleanup. At the time this is invoked |web_contents()| returns NULL. |
| 135 // It is safe to delete 'this' from here. | 134 // It is safe to delete 'this' from here. |
| 136 virtual void WebContentsDestroyed(WebContents* web_contents) {} | 135 virtual void WebContentsDestroyed(WebContents* web_contents) {} |
| 137 | 136 |
| 138 // Called when the user agent override for a WebContents has been changed. | 137 // Called when the user agent override for a WebContents has been changed. |
| 139 virtual void UserAgentOverrideSet(const std::string& user_agent) {} | 138 virtual void UserAgentOverrideSet(const std::string& user_agent) {} |
| 140 | 139 |
| 141 // Requests permission to access the PPAPI broker. If the object handles the | |
| 142 // request, it should return true and eventually call the passed in |callback| | |
| 143 // with the result. Otherwise it should return false, in which case the next | |
| 144 // observer will be called. | |
| 145 // Implementations should make sure not to call the callback after the | |
| 146 // WebContents has been destroyed. | |
| 147 virtual bool RequestPpapiBrokerPermission( | |
| 148 WebContents* web_contents, | |
| 149 const GURL& url, | |
| 150 const FilePath& plugin_path, | |
| 151 const base::Callback<void(bool)>& callback); | |
| 152 | |
| 153 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just | 140 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just |
| 154 // blocked on the current page, specifically because the GPU was | 141 // blocked on the current page, specifically because the GPU was |
| 155 // reset recently. | 142 // reset recently. |
| 156 virtual void DidBlock3DAPIs(const GURL& url, | 143 virtual void DidBlock3DAPIs(const GURL& url, |
| 157 ThreeDAPIType requester) {} | 144 ThreeDAPIType requester) {} |
| 158 | 145 |
| 159 // IPC::Listener implementation. | 146 // IPC::Listener implementation. |
| 160 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 147 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 161 | 148 |
| 162 // IPC::Sender implementation. | 149 // IPC::Sender implementation. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 188 void WebContentsImplDestroyed(); | 175 void WebContentsImplDestroyed(); |
| 189 | 176 |
| 190 WebContentsImpl* web_contents_; | 177 WebContentsImpl* web_contents_; |
| 191 | 178 |
| 192 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 179 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 193 }; | 180 }; |
| 194 | 181 |
| 195 } // namespace content | 182 } // namespace content |
| 196 | 183 |
| 197 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 184 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |