| Index: chrome/renderer/browser_plugin/chrome_browser_plugin_observer.cc
|
| diff --git a/chrome/renderer/browser_plugin/chrome_browser_plugin_observer.cc b/chrome/renderer/browser_plugin/chrome_browser_plugin_observer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..35016cee396cde0074752e3c785ea54cf9294189
|
| --- /dev/null
|
| +++ b/chrome/renderer/browser_plugin/chrome_browser_plugin_observer.cc
|
| @@ -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.
|
| +
|
| +#include "chrome/renderer/browser_plugin/chrome_browser_plugin_observer.h"
|
| +
|
| +#include <stdio.h>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/values.h"
|
| +#include "chrome/common/chrome_browser_plugin_messages.h"
|
| +#include "chrome/renderer/browser_plugin/chrome_webview_bindings.cc"
|
| +#include "content/public/renderer/browser_plugin/browser_plugin.h"
|
| +#include "content/public/renderer/browser_plugin/browser_plugin_method_binding.h"
|
| +#include "content/public/renderer/v8_value_converter.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
|
| +#include "v8/include/v8.h"
|
| +
|
| +namespace {
|
| +
|
| +} // namespace
|
| +
|
| +namespace chrome {
|
| +
|
| +ChromeBrowserPluginObserver::ChromeBrowserPluginObserver(
|
| + content::BrowserPlugin* browser_plugin) :
|
| + content::BrowserPluginObserver(browser_plugin) {
|
| + browser_plugin->AddMethodBinding(new WebViewMethodBindingBack(this));
|
| + browser_plugin->AddMethodBinding(new WebViewMethodBindingForward(this));
|
| + browser_plugin->AddMethodBinding(new WebViewMethodBindingGo(this));
|
| +}
|
| +
|
| +ChromeBrowserPluginObserver::~ChromeBrowserPluginObserver() {
|
| +}
|
| +
|
| +void ChromeBrowserPluginObserver::Go(int relative_index) {
|
| + if (!browser_plugin()->HasGuest())
|
| + return;
|
| + Send(new ChromeBrowserPluginHostMsg_Go(browser_plugin()->GetRoutingID(),
|
| + relative_index));
|
| +}
|
| +
|
| +bool ChromeBrowserPluginObserver::OnMessageReceived(
|
| + const IPC::Message& message) {
|
| + bool handled = true;
|
| + IPC_BEGIN_MESSAGE_MAP(ChromeBrowserPluginObserver, message)
|
| + IPC_MESSAGE_UNHANDLED(handled = false)
|
| + IPC_END_MESSAGE_MAP()
|
| + return handled;
|
| +}
|
| +
|
| +} // namespace chrome
|
|
|