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/logging.h" |
8 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
9 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
11 #include "content/public/browser/navigation_controller.h" | 12 #include "content/public/browser/navigation_controller.h" |
12 #include "content/public/common/page_transition_types.h" | 13 #include "content/public/common/page_transition_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 "ui/base/window_open_disposition.h" | 16 #include "ui/base/window_open_disposition.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 259 |
259 // Invoked before a form repost warning is shown. | 260 // Invoked before a form repost warning is shown. |
260 virtual void BeforeFormRepostWarningShow() {} | 261 virtual void BeforeFormRepostWarningShow() {} |
261 | 262 |
262 // Invoked when the beforeunload handler fires. The time is from the renderer. | 263 // Invoked when the beforeunload handler fires. The time is from the renderer. |
263 virtual void BeforeUnloadFired(const base::TimeTicks& proceed_time) {} | 264 virtual void BeforeUnloadFired(const base::TimeTicks& proceed_time) {} |
264 | 265 |
265 // Invoked when a user cancels a before unload dialog. | 266 // Invoked when a user cancels a before unload dialog. |
266 virtual void BeforeUnloadDialogCancelled() {} | 267 virtual void BeforeUnloadDialogCancelled() {} |
267 | 268 |
| 269 // Invoked when a message is added to the console. This includes errors, logs, |
| 270 // warnings, and exceptions. |
| 271 virtual void OnMessageAddedToConsole(const base::string16& source, |
| 272 const base::string16& message, |
| 273 const base::string16& stack_trace, |
| 274 int32 line_number, |
| 275 logging::LogSeverity level) {} |
| 276 |
268 // IPC::Listener implementation. | 277 // IPC::Listener implementation. |
269 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 278 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
270 | 279 |
271 // IPC::Sender implementation. | 280 // IPC::Sender implementation. |
272 virtual bool Send(IPC::Message* message) OVERRIDE; | 281 virtual bool Send(IPC::Message* message) OVERRIDE; |
273 int routing_id() const; | 282 int routing_id() const; |
274 | 283 |
275 protected: | 284 protected: |
276 // Use this constructor when the object is tied to a single WebContents for | 285 // Use this constructor when the object is tied to a single WebContents for |
277 // its entire lifetime. | 286 // its entire lifetime. |
(...skipping 19 matching lines...) Expand all Loading... |
297 void WebContentsImplDestroyed(); | 306 void WebContentsImplDestroyed(); |
298 | 307 |
299 WebContentsImpl* web_contents_; | 308 WebContentsImpl* web_contents_; |
300 | 309 |
301 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 310 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
302 }; | 311 }; |
303 | 312 |
304 } // namespace content | 313 } // namespace content |
305 | 314 |
306 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 315 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |