| Index: chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.cc
|
| diff --git a/chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.cc b/chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a91dcabec9fda3c6ed077dc4eb4338e08854b252
|
| --- /dev/null
|
| +++ b/chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.cc
|
| @@ -0,0 +1,47 @@
|
| +// 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/browser/browser_plugin/chrome_browser_plugin_guest_observer.h"
|
| +
|
| +#include <stdio.h>
|
| +
|
| +#include "base/files/file_path.h"
|
| +#include "base/values.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/common/chrome_browser_plugin_messages.h"
|
| +#include "chrome/common/extensions/api/tabs.h"
|
| +#include "chrome/common/extensions/extension_messages.h"
|
| +#include "chrome/common/extensions/value_builder.h"
|
| +#include "content/public/browser/browser_plugin/browser_plugin_guest.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +
|
| +ChromeBrowserPluginGuestObserver::ChromeBrowserPluginGuestObserver(
|
| + content::BrowserPluginGuest* guest)
|
| + : content::BrowserPluginGuestObserver(guest) {
|
| + AddRef();
|
| +}
|
| +
|
| +ChromeBrowserPluginGuestObserver::~ChromeBrowserPluginGuestObserver() {
|
| +}
|
| +
|
| +void ChromeBrowserPluginGuestObserver::OnDestruct() {
|
| + Release();
|
| +}
|
| +
|
| +bool ChromeBrowserPluginGuestObserver::OnMessageReceivedFromEmbedder(
|
| + const IPC::Message& message) {
|
| + bool handled = true;
|
| + IPC_BEGIN_MESSAGE_MAP(ChromeBrowserPluginGuestObserver, message)
|
| + IPC_MESSAGE_HANDLER(ChromeBrowserPluginHostMsg_Go, OnGo)
|
| + IPC_MESSAGE_UNHANDLED(handled = false)
|
| + IPC_END_MESSAGE_MAP()
|
| + return handled;
|
| +}
|
| +
|
| +void ChromeBrowserPluginGuestObserver::OnGo(int relative_index) {
|
| + browser_plugin_guest()->GetWebContents()->GetController().GoToOffset(
|
| + relative_index);
|
| +}
|
| +
|
| +
|
|
|