Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / chrome / renderer / extensions / chrome_v8_extension_handler.h
blob4802d839881768b146d3527e5c13781e69f7b042
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
3 // found in the LICENSE file.
5 #ifndef CHROME_RENDERER_EXTENSIONS_CHROME_V8_EXTENSION_HANDLER_H_
6 #define CHROME_RENDERER_EXTENSIONS_CHROME_V8_EXTENSION_HANDLER_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "ipc/ipc_listener.h"
12 #include "v8/include/v8.h"
14 namespace extensions {
15 class ScriptContext;
17 // Base class for context-scoped handlers used with ChromeV8Extension.
18 // TODO(koz): Rename/refactor this somehow. Maybe just pull it into
19 // ChromeV8Extension.
20 class ChromeV8ExtensionHandler : public IPC::Listener {
21 public:
22 ~ChromeV8ExtensionHandler() override;
24 // IPC::Listener
25 bool OnMessageReceived(const IPC::Message& message) override = 0;
27 protected:
28 explicit ChromeV8ExtensionHandler(ScriptContext* context);
29 int GetRoutingID();
30 void Send(IPC::Message* message);
31 ScriptContext* context_;
33 private:
34 int routing_id_;
35 DISALLOW_COPY_AND_ASSIGN(ChromeV8ExtensionHandler);
38 } // namespace extensions
40 #endif // CHROME_RENDERER_EXTENSIONS_CHROME_V8_EXTENSION_HANDLER_H_