OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/renderer/browser_plugin/chrome_browser_plugin_observer.h" |
| 6 |
| 7 #include <stdio.h> |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/values.h" |
| 11 #include "chrome/common/chrome_browser_plugin_messages.h" |
| 12 #include "chrome/renderer/browser_plugin/chrome_webview_bindings.cc" |
| 13 #include "content/public/renderer/browser_plugin/browser_plugin.h" |
| 14 #include "content/public/renderer/browser_plugin/browser_plugin_method_binding.h
" |
| 15 #include "content/public/renderer/v8_value_converter.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 20 #include "v8/include/v8.h" |
| 21 |
| 22 namespace { |
| 23 |
| 24 } // namespace |
| 25 |
| 26 namespace chrome { |
| 27 |
| 28 ChromeBrowserPluginObserver::ChromeBrowserPluginObserver( |
| 29 content::BrowserPlugin* browser_plugin) : |
| 30 content::BrowserPluginObserver(browser_plugin) { |
| 31 browser_plugin->AddMethodBinding(new WebViewMethodBindingBack(this)); |
| 32 browser_plugin->AddMethodBinding(new WebViewMethodBindingForward(this)); |
| 33 browser_plugin->AddMethodBinding(new WebViewMethodBindingGo(this)); |
| 34 } |
| 35 |
| 36 ChromeBrowserPluginObserver::~ChromeBrowserPluginObserver() { |
| 37 } |
| 38 |
| 39 void ChromeBrowserPluginObserver::Go(int relative_index) { |
| 40 if (!browser_plugin()->HasGuest()) |
| 41 return; |
| 42 Send(new ChromeBrowserPluginHostMsg_Go(browser_plugin()->GetRoutingID(), |
| 43 relative_index)); |
| 44 } |
| 45 |
| 46 bool ChromeBrowserPluginObserver::OnMessageReceived( |
| 47 const IPC::Message& message) { |
| 48 bool handled = true; |
| 49 IPC_BEGIN_MESSAGE_MAP(ChromeBrowserPluginObserver, message) |
| 50 IPC_MESSAGE_UNHANDLED(handled = false) |
| 51 IPC_END_MESSAGE_MAP() |
| 52 return handled; |
| 53 } |
| 54 |
| 55 } // namespace chrome |
OLD | NEW |