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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 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 "content/browser/browser_plugin/test_browser_plugin_guest_delegate.h"
6
7 #include "content/browser/browser_plugin/browser_plugin_guest.h"
8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/common/referrer.h"
11
12 namespace content {
13
14 TestBrowserPluginGuestDelegate::TestBrowserPluginGuestDelegate(
15 BrowserPluginGuest* guest) :
16 guest_(guest) {
17 }
18
19 TestBrowserPluginGuestDelegate::~TestBrowserPluginGuestDelegate() {
20 }
21
22 void TestBrowserPluginGuestDelegate::LoadURLWithParams(
23 const GURL& url,
24 const Referrer& referrer,
25 PageTransition transition_type,
26 WebContents* web_contents) {
27 NavigationController::LoadURLParams load_url_params(url);
28 load_url_params.referrer = referrer;
29 load_url_params.transition_type = transition_type;
30 load_url_params.extra_headers = std::string();
31 web_contents->GetController().LoadURLWithParams(load_url_params);
32 }
33
34 void TestBrowserPluginGuestDelegate::Destroy() {
35 if (!destruction_callback_.is_null())
36 destruction_callback_.Run(guest_->GetWebContents());
37 delete guest_->GetWebContents();
38 }
39
40 void TestBrowserPluginGuestDelegate::NavigateGuest(const std::string& src) {
41 GURL url(src);
42 LoadURLWithParams(url,
43 Referrer(),
44 PAGE_TRANSITION_AUTO_TOPLEVEL,
45 guest_->GetWebContents());
46 }
47
48 void TestBrowserPluginGuestDelegate::RegisterDestructionCallback(
49 const DestructionCallback& callback) {
50 destruction_callback_ = callback;
51 }
52
53
54 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698