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. |source| is the WebKit-reported source of the |
| 271 // error (which can be either external or internal), |message| is the error |
| 272 // message, and |stack_trace| is an optional stack trace of the error in a |
| 273 // human-readable format (each frame is formatted as |
| 274 // "\n at function_name (source:line_number:column_number)"). |
| 275 virtual void OnMessageAddedToConsole(const base::string16& source, |
| 276 const base::string16& message, |
| 277 const base::string16& stack_trace, |
| 278 int32 line_number, |
| 279 logging::LogSeverity level) {} |
| 280 |
268 // IPC::Listener implementation. | 281 // IPC::Listener implementation. |
269 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 282 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
270 | 283 |
271 // IPC::Sender implementation. | 284 // IPC::Sender implementation. |
272 virtual bool Send(IPC::Message* message) OVERRIDE; | 285 virtual bool Send(IPC::Message* message) OVERRIDE; |
273 int routing_id() const; | 286 int routing_id() const; |
274 | 287 |
275 protected: | 288 protected: |
276 // Use this constructor when the object is tied to a single WebContents for | 289 // Use this constructor when the object is tied to a single WebContents for |
277 // its entire lifetime. | 290 // its entire lifetime. |
(...skipping 19 matching lines...) Expand all Loading... |
297 void WebContentsImplDestroyed(); | 310 void WebContentsImplDestroyed(); |
298 | 311 |
299 WebContentsImpl* web_contents_; | 312 WebContentsImpl* web_contents_; |
300 | 313 |
301 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 314 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
302 }; | 315 }; |
303 | 316 |
304 } // namespace content | 317 } // namespace content |
305 | 318 |
306 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 319 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |