| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_RENDER_PROCESS_OBSERVER_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_PROCESS_OBSERVER_H_ |
| 6 #define CONTENT_RENDERER_RENDER_PROCESS_OBSERVER_H_ | 6 #define CONTENT_RENDERER_RENDER_PROCESS_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 // Base class for objects that want to filter control IPC messages and get | 14 // Base class for objects that want to filter control IPC messages and get |
| 15 // notified of events. | 15 // notified of events. |
| 16 class RenderProcessObserver { | 16 class RenderProcessObserver : public IPC::Message::Sender { |
| 17 public: | 17 public: |
| 18 RenderProcessObserver(); | 18 RenderProcessObserver(); |
| 19 virtual ~RenderProcessObserver(); | 19 virtual ~RenderProcessObserver(); |
| 20 | 20 |
| 21 // IPC::Message::Sender |
| 22 virtual bool Send(IPC::Message* message); |
| 23 |
| 21 // Allows filtering of control messages. | 24 // Allows filtering of control messages. |
| 22 virtual bool OnControlMessageReceived(const IPC::Message& message); | 25 virtual bool OnControlMessageReceived(const IPC::Message& message); |
| 23 | 26 |
| 24 // Notification that the render process is shutting down. | 27 // Notification that the render process is shutting down. |
| 25 virtual void OnRenderProcessShutdown(); | 28 virtual void OnRenderProcessShutdown(); |
| 26 | 29 |
| 27 // Called right after the WebKit API is initialized. | 30 // Called right after the WebKit API is initialized. |
| 28 virtual void WebKitInitialized(); | 31 virtual void WebKitInitialized(); |
| 29 | 32 |
| 30 // See WebViewClient::allowScriptExtension | 33 // See WebViewClient::allowScriptExtension |
| 31 virtual bool AllowScriptExtension(const std::string& v8_extension_name, | 34 virtual bool AllowScriptExtension(const std::string& v8_extension_name, |
| 32 const GURL& url, | 35 const GURL& url, |
| 33 int extension_group); | 36 int extension_group); |
| 34 | 37 |
| 35 virtual void IdleNotification(); | 38 virtual void IdleNotification(); |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(RenderProcessObserver); | 41 DISALLOW_COPY_AND_ASSIGN(RenderProcessObserver); |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 #endif // CONTENT_RENDERER_RENDER_PROCESS_OBSERVER_H_ | 44 #endif // CONTENT_RENDERER_RENDER_PROCESS_OBSERVER_H_ |
| OLD | NEW |