OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/browser_plugin/test_browser_plugin_guest_delegate.h" | 5 #include "content/browser/browser_plugin/test_browser_plugin_guest_delegate.h" |
6 | 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 |
7 namespace content { | 12 namespace content { |
8 | 13 |
9 TestBrowserPluginGuestDelegate::TestBrowserPluginGuestDelegate() | 14 TestBrowserPluginGuestDelegate::TestBrowserPluginGuestDelegate( |
10 : load_aborted_(false) { | 15 BrowserPluginGuest* guest) : |
| 16 guest_(guest) { |
11 } | 17 } |
12 | 18 |
13 TestBrowserPluginGuestDelegate::~TestBrowserPluginGuestDelegate() { | 19 TestBrowserPluginGuestDelegate::~TestBrowserPluginGuestDelegate() { |
14 } | 20 } |
15 | 21 |
16 void TestBrowserPluginGuestDelegate::ResetStates() { | 22 void TestBrowserPluginGuestDelegate::LoadURLWithParams( |
17 load_aborted_ = false; | 23 const GURL& url, |
18 load_aborted_url_ = GURL(); | 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 if (IsOverridingUserAgent()) { |
| 32 load_url_params.override_user_agent = |
| 33 NavigationController::UA_OVERRIDE_TRUE; |
| 34 } |
| 35 web_contents->GetController().LoadURLWithParams(load_url_params); |
19 } | 36 } |
20 | 37 |
21 void TestBrowserPluginGuestDelegate::AddMessageToConsole( | 38 void TestBrowserPluginGuestDelegate::NavigateGuest(const std::string& src) { |
22 int32 level, | 39 GURL url(src); |
23 const base::string16& message, | 40 LoadURLWithParams(url, |
24 int32 line_no, | 41 Referrer(), |
25 const base::string16& source_id) { | 42 PAGE_TRANSITION_AUTO_TOPLEVEL, |
26 } | 43 guest_->GetWebContents()); |
27 | |
28 void TestBrowserPluginGuestDelegate::Close() { | |
29 } | |
30 | |
31 void TestBrowserPluginGuestDelegate::GuestProcessGone( | |
32 base::TerminationStatus status) { | |
33 } | |
34 | |
35 bool TestBrowserPluginGuestDelegate::HandleKeyboardEvent( | |
36 const NativeWebKeyboardEvent& event) { | |
37 return BrowserPluginGuestDelegate::HandleKeyboardEvent(event); | |
38 } | |
39 | |
40 void TestBrowserPluginGuestDelegate::LoadAbort(bool is_top_level, | |
41 const GURL& url, | |
42 const std::string& error_type) { | |
43 load_aborted_ = true; | |
44 load_aborted_url_ = url; | |
45 } | |
46 | |
47 void TestBrowserPluginGuestDelegate::RendererResponsive() { | |
48 } | |
49 | |
50 void TestBrowserPluginGuestDelegate::RendererUnresponsive() { | |
51 } | |
52 | |
53 void TestBrowserPluginGuestDelegate::RequestPermission( | |
54 BrowserPluginPermissionType permission_type, | |
55 const base::DictionaryValue& request_info, | |
56 const PermissionResponseCallback& callback, | |
57 bool allowed_by_default) { | |
58 } | |
59 | |
60 void TestBrowserPluginGuestDelegate::SizeChanged(const gfx::Size& old_size, | |
61 const gfx::Size& new_size) { | |
62 } | 44 } |
63 | 45 |
64 } // namespace content | 46 } // namespace content |
OLD | NEW |