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

Unified Diff: content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc

Issue 272573005: <webview>: Move NewWindow API to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_rename
Patch Set: Merge with ToT Created 6 years, 7 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: content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc
diff --git a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..020d2fe9f5ae0ba39d6cfc9e76d5757db7b3352b
--- /dev/null
+++ b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc
@@ -0,0 +1,54 @@
+// Copyright 2013 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 "content/browser/browser_plugin/test_browser_plugin_guest_delegate.h"
+
+#include "content/browser/browser_plugin/browser_plugin_guest.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/navigation_controller.h"
+#include "content/public/common/referrer.h"
+
+namespace content {
+
+TestBrowserPluginGuestDelegate::TestBrowserPluginGuestDelegate(
+ BrowserPluginGuest* guest) :
+ guest_(guest) {
+}
+
+TestBrowserPluginGuestDelegate::~TestBrowserPluginGuestDelegate() {
+}
+
+void TestBrowserPluginGuestDelegate::LoadURLWithParams(
+ const GURL& url,
+ const Referrer& referrer,
+ PageTransition transition_type,
+ WebContents* web_contents) {
+ NavigationController::LoadURLParams load_url_params(url);
+ load_url_params.referrer = referrer;
+ load_url_params.transition_type = transition_type;
+ load_url_params.extra_headers = std::string();
+ web_contents->GetController().LoadURLWithParams(load_url_params);
+}
+
+void TestBrowserPluginGuestDelegate::Destroy() {
+ if (!destruction_callback_.is_null())
+ destruction_callback_.Run(guest_->GetWebContents());
+ delete guest_->GetWebContents();
+}
+
+void TestBrowserPluginGuestDelegate::NavigateGuest(const std::string& src) {
+ GURL url(src);
+ LoadURLWithParams(url,
+ Referrer(),
+ PAGE_TRANSITION_AUTO_TOPLEVEL,
+ guest_->GetWebContents());
+}
+
+void TestBrowserPluginGuestDelegate::RegisterDestructionCallback(
+ const DestructionCallback& callback) {
+ destruction_callback_ = callback;
+}
+
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698