OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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. |
| 4 |
| 5 #ifndef CHROME_RENDERER_BROWSER_PLUGIN_CHROME_WEBVIEW_BINDINGS_H_ |
| 6 #define CHROME_RENDERER_BROWSER_PLUGIN_CHROME_WEBVIEW_BINDINGS_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "content/public/renderer/browser_plugin/browser_plugin_method_binding.h
" |
| 10 #include "content/public/renderer/browser_plugin/browser_plugin_property_binding
.h" |
| 11 |
| 12 namespace chrome { |
| 13 |
| 14 class ChromeBrowserPluginObserver; |
| 15 |
| 16 class WebViewMethodBinding : public content::BrowserPluginMethodBinding { |
| 17 public: |
| 18 WebViewMethodBinding(ChromeBrowserPluginObserver* browser_plugin_observer, |
| 19 const char name[], uint32 arg_count); |
| 20 virtual ~WebViewMethodBinding(); |
| 21 |
| 22 // TODO(fsamuel): This should be called webview_observer(). |
| 23 ChromeBrowserPluginObserver* browser_plugin_observer() const { |
| 24 return browser_plugin_observer_; |
| 25 } |
| 26 |
| 27 // BrowserPluginMethodBinding implementation. |
| 28 virtual const std::string& GetName() const OVERRIDE; |
| 29 virtual uint32 GetArgCount() const OVERRIDE; |
| 30 |
| 31 private: |
| 32 ChromeBrowserPluginObserver* const browser_plugin_observer_; |
| 33 const std::string name_; |
| 34 const uint32 arg_count_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(WebViewMethodBinding); |
| 37 }; |
| 38 |
| 39 class WebViewPropertyBinding : public content::BrowserPluginPropertyBinding { |
| 40 public: |
| 41 explicit WebViewPropertyBinding(const char name[]); |
| 42 virtual ~WebViewPropertyBinding(); |
| 43 |
| 44 // BrowserPluginPropertyBinding implementation. |
| 45 virtual const std::string& GetName() const OVERRIDE; |
| 46 |
| 47 private: |
| 48 const std::string name_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(WebViewPropertyBinding); |
| 51 }; |
| 52 |
| 53 class WebViewMethodBindingBack : public WebViewMethodBinding { |
| 54 public: |
| 55 WebViewMethodBindingBack( |
| 56 ChromeBrowserPluginObserver* browser_plugin_observer); |
| 57 virtual ~WebViewMethodBindingBack(); |
| 58 |
| 59 virtual bool Invoke(const NPVariant* args, NPVariant* result) OVERRIDE; |
| 60 |
| 61 private: |
| 62 DISALLOW_COPY_AND_ASSIGN(WebViewMethodBindingBack); |
| 63 }; |
| 64 |
| 65 class WebViewMethodBindingForward : public WebViewMethodBinding { |
| 66 public: |
| 67 WebViewMethodBindingForward( |
| 68 ChromeBrowserPluginObserver* browser_plugin_observer); |
| 69 virtual ~WebViewMethodBindingForward(); |
| 70 |
| 71 virtual bool Invoke(const NPVariant* args, NPVariant* result) OVERRIDE; |
| 72 |
| 73 private: |
| 74 DISALLOW_COPY_AND_ASSIGN(WebViewMethodBindingForward); |
| 75 }; |
| 76 |
| 77 class WebViewMethodBindingGo : public WebViewMethodBinding { |
| 78 public: |
| 79 WebViewMethodBindingGo( |
| 80 ChromeBrowserPluginObserver* browser_plugin_observer); |
| 81 virtual ~WebViewMethodBindingGo(); |
| 82 |
| 83 virtual bool Invoke(const NPVariant* args, NPVariant* result) OVERRIDE; |
| 84 |
| 85 private: |
| 86 DISALLOW_COPY_AND_ASSIGN(WebViewMethodBindingGo); |
| 87 }; |
| 88 |
| 89 } // namespace chrome |
| 90 |
| 91 #endif // CHROME_RENDERER_BROWSER_PLUGIN_CHROME_WEBVIEW_BINDINGS_H_ |
OLD | NEW |