| 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_RENDERER_RENDER_THREAD_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_THREAD_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/common/associated_interface_registry.h" |
| 10 | 11 |
| 11 namespace IPC { | 12 namespace IPC { |
| 12 class Message; | 13 class Message; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 // Base class for objects that want to filter control IPC messages and get | 18 // Base class for objects that want to filter control IPC messages and get |
| 18 // notified of events. | 19 // notified of events. |
| 19 class CONTENT_EXPORT RenderThreadObserver { | 20 class CONTENT_EXPORT RenderThreadObserver { |
| 20 public: | 21 public: |
| 21 RenderThreadObserver() {} | 22 RenderThreadObserver() {} |
| 22 virtual ~RenderThreadObserver() {} | 23 virtual ~RenderThreadObserver() {} |
| 23 | 24 |
| 25 // Allows handling incoming Mojo requests. |
| 26 virtual void RegisterMojoInterfaces( |
| 27 AssociatedInterfaceRegistry* associated_interfaces) {} |
| 28 |
| 24 // Allows filtering of control messages. | 29 // Allows filtering of control messages. |
| 25 virtual bool OnControlMessageReceived(const IPC::Message& message); | 30 virtual bool OnControlMessageReceived(const IPC::Message& message); |
| 26 | 31 |
| 27 // Notification that the render process is shutting down. | 32 // Notification that the render process is shutting down. |
| 28 virtual void OnRenderProcessShutdown() {} | 33 virtual void OnRenderProcessShutdown() {} |
| 29 | 34 |
| 30 // Called when the renderer cache of the plugin list has changed. | 35 // Called when the renderer cache of the plugin list has changed. |
| 31 virtual void PluginListChanged() {} | 36 virtual void PluginListChanged() {} |
| 32 | 37 |
| 33 virtual void IdleNotification() {} | 38 virtual void IdleNotification() {} |
| 34 | 39 |
| 35 // Called when the network state changes. | 40 // Called when the network state changes. |
| 36 virtual void NetworkStateChanged(bool online) {} | 41 virtual void NetworkStateChanged(bool online) {} |
| 37 | 42 |
| 38 private: | 43 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(RenderThreadObserver); | 44 DISALLOW_COPY_AND_ASSIGN(RenderThreadObserver); |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 } // namespace content | 47 } // namespace content |
| 43 | 48 |
| 44 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_OBSERVER_H_ | 49 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_OBSERVER_H_ |
| OLD | NEW |