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" |
8 #include "base/process_util.h" | 9 #include "base/process_util.h" |
9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
10 #include "content/public/browser/navigation_controller.h" | 11 #include "content/public/browser/navigation_controller.h" |
11 #include "content/public/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
12 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
13 #include "ipc/ipc_sender.h" | 14 #include "ipc/ipc_sender.h" |
14 #include "webkit/glue/window_open_disposition.h" | 15 #include "webkit/glue/window_open_disposition.h" |
15 | 16 |
16 class WebContentsImpl; | 17 class WebContentsImpl; |
17 | 18 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 bool is_hung) {} | 123 bool is_hung) {} |
123 | 124 |
124 // Invoked when the WebContents is being destroyed. Gives subclasses a chance | 125 // Invoked when the WebContents is being destroyed. Gives subclasses a chance |
125 // to cleanup. At the time this is invoked |web_contents()| returns NULL. | 126 // to cleanup. At the time this is invoked |web_contents()| returns NULL. |
126 // It is safe to delete 'this' from here. | 127 // It is safe to delete 'this' from here. |
127 virtual void WebContentsDestroyed(WebContents* web_contents) {} | 128 virtual void WebContentsDestroyed(WebContents* web_contents) {} |
128 | 129 |
129 // Called when the user agent override for a WebContents has been changed. | 130 // Called when the user agent override for a WebContents has been changed. |
130 virtual void UserAgentOverrideSet(const std::string& user_agent) {} | 131 virtual void UserAgentOverrideSet(const std::string& user_agent) {} |
131 | 132 |
| 133 // Requests permission to access the PPAPI broker. If the object handles the |
| 134 // request, it should return true and eventually call the passed in |callback| |
| 135 // with the result. Otherwise it should return false, in which case the next |
| 136 // observer will be called. |
| 137 // Implementations should make sure not to call the callback after the |
| 138 // WebContents has been destroyed. |
| 139 virtual bool RequestPpapiBrokerPermission( |
| 140 WebContents* web_contents, |
| 141 const GURL& url, |
| 142 const FilePath& plugin_path, |
| 143 const base::Callback<void(bool)>& callback); |
| 144 |
132 // IPC::Listener implementation. | 145 // IPC::Listener implementation. |
133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 146 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
134 | 147 |
135 // IPC::Sender implementation. | 148 // IPC::Sender implementation. |
136 virtual bool Send(IPC::Message* message) OVERRIDE; | 149 virtual bool Send(IPC::Message* message) OVERRIDE; |
137 int routing_id() const; | 150 int routing_id() const; |
138 | 151 |
139 protected: | 152 protected: |
140 // Use this constructor when the object is tied to a single WebContents for | 153 // Use this constructor when the object is tied to a single WebContents for |
141 // its entire lifetime. | 154 // its entire lifetime. |
(...skipping 19 matching lines...) Expand all Loading... |
161 void WebContentsImplDestroyed(); | 174 void WebContentsImplDestroyed(); |
162 | 175 |
163 WebContentsImpl* web_contents_; | 176 WebContentsImpl* web_contents_; |
164 | 177 |
165 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 178 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
166 }; | 179 }; |
167 | 180 |
168 } // namespace content | 181 } // namespace content |
169 | 182 |
170 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 183 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |