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/browser/browser_plugin/chrome_browser_plugin_guest_observer.h" |
| 6 |
| 7 #include <stdio.h> |
| 8 |
| 9 #include "base/files/file_path.h" |
| 10 #include "base/values.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/common/chrome_browser_plugin_messages.h" |
| 13 #include "chrome/common/extensions/api/tabs.h" |
| 14 #include "chrome/common/extensions/extension_messages.h" |
| 15 #include "chrome/common/extensions/value_builder.h" |
| 16 #include "content/public/browser/browser_plugin/browser_plugin_guest.h" |
| 17 #include "content/public/browser/web_contents.h" |
| 18 |
| 19 ChromeBrowserPluginGuestObserver::ChromeBrowserPluginGuestObserver( |
| 20 content::BrowserPluginGuest* guest) |
| 21 : content::BrowserPluginGuestObserver(guest) { |
| 22 AddRef(); |
| 23 } |
| 24 |
| 25 ChromeBrowserPluginGuestObserver::~ChromeBrowserPluginGuestObserver() { |
| 26 } |
| 27 |
| 28 void ChromeBrowserPluginGuestObserver::OnDestruct() { |
| 29 Release(); |
| 30 } |
| 31 |
| 32 bool ChromeBrowserPluginGuestObserver::OnMessageReceivedFromEmbedder( |
| 33 const IPC::Message& message) { |
| 34 bool handled = true; |
| 35 IPC_BEGIN_MESSAGE_MAP(ChromeBrowserPluginGuestObserver, message) |
| 36 IPC_MESSAGE_HANDLER(ChromeBrowserPluginHostMsg_Go, OnGo) |
| 37 IPC_MESSAGE_UNHANDLED(handled = false) |
| 38 IPC_END_MESSAGE_MAP() |
| 39 return handled; |
| 40 } |
| 41 |
| 42 void ChromeBrowserPluginGuestObserver::OnGo(int relative_index) { |
| 43 browser_plugin_guest()->GetWebContents()->GetController().GoToOffset( |
| 44 relative_index); |
| 45 } |
| 46 |
| 47 |
OLD | NEW |