Chromium Code Reviews| Index: content/public/renderer/browser_plugin/browser_plugin_observer.h |
| diff --git a/content/public/renderer/browser_plugin/browser_plugin_observer.h b/content/public/renderer/browser_plugin/browser_plugin_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..807ddb2063db3acb592118077282b74957445323 |
| --- /dev/null |
| +++ b/content/public/renderer/browser_plugin/browser_plugin_observer.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_OBSERVER_H_ |
| +#define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_OBSERVER_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "content/common/content_export.h" |
| +#include "ipc/ipc_listener.h" |
| +#include "ipc/ipc_sender.h" |
| + |
| +namespace content { |
| + |
| +class BrowserPlugin; |
| +class BrowserPluginImpl; |
| + |
| +class CONTENT_EXPORT BrowserPluginObserver : public IPC::Listener, |
|
sadrul
2013/01/09 15:21:54
It looks like a BPO can be an observer for a singl
Fady Samuel
2013/01/09 17:41:24
Done.
|
| + public IPC::Sender { |
| + public: |
| + // By default, observers will be deleted when the BrowserPlugin goes away. If |
| + // they want to outlive it, they can override this function. |
| + virtual void OnDestruct(); |
| + |
| + // IPC::Listener implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + protected: |
| + explicit BrowserPluginObserver(BrowserPlugin* browser_plugin); |
| + virtual ~BrowserPluginObserver(); |
| + |
| + // IPC::Sender implementation. |
| + virtual bool Send(IPC::Message* message) OVERRIDE; |
| + |
| + BrowserPlugin* browser_plugin() const; |
| + int instance_id() { return instance_id_; } |
|
sadrul
2013/01/09 15:21:54
const this too?
Fady Samuel
2013/01/09 17:41:24
Done.
|
| + |
| + private: |
| + friend class BrowserPluginImpl; |
| + |
| + // This is called by the BrowserPlugin when it's going away so that this |
| + // object can null out its pointer. |
| + void BrowserPluginGone(); |
| + |
| + BrowserPlugin* browser_plugin_; |
| + // The instance ID of the associated BrowserPlugin. |
| + int instance_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPluginObserver); |
| + |
|
sadrul
2013/01/09 15:21:54
remove blank line
Fady Samuel
2013/01/09 17:41:24
Done.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_OBSERVER_H_ |