Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.cc

Issue 12326168: Move <webview> API to chrome layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+}
+
+
« no previous file with comments | « chrome/browser/browser_plugin/chrome_browser_plugin_guest_observer.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698