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

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: Cleanup and fix tests 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
index ec3c0d61c34bc749633f890ddc3b43e58ed2b500..07ecbe0cb3b16959e5767e2022c3231df452dc9e 100644
--- a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc
+++ b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc
@@ -4,61 +4,43 @@
#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()
- : load_aborted_(false) {
+TestBrowserPluginGuestDelegate::TestBrowserPluginGuestDelegate(
+ BrowserPluginGuest* guest) :
+ guest_(guest) {
}
TestBrowserPluginGuestDelegate::~TestBrowserPluginGuestDelegate() {
}
-void TestBrowserPluginGuestDelegate::ResetStates() {
- load_aborted_ = false;
- load_aborted_url_ = GURL();
-}
-
-void TestBrowserPluginGuestDelegate::AddMessageToConsole(
- int32 level,
- const base::string16& message,
- int32 line_no,
- const base::string16& source_id) {
-}
-
-void TestBrowserPluginGuestDelegate::Close() {
-}
-
-void TestBrowserPluginGuestDelegate::GuestProcessGone(
- base::TerminationStatus status) {
-}
-
-bool TestBrowserPluginGuestDelegate::HandleKeyboardEvent(
- const NativeWebKeyboardEvent& event) {
- return BrowserPluginGuestDelegate::HandleKeyboardEvent(event);
-}
-
-void TestBrowserPluginGuestDelegate::LoadAbort(bool is_top_level,
- const GURL& url,
- const std::string& error_type) {
- load_aborted_ = true;
- load_aborted_url_ = url;
-}
-
-void TestBrowserPluginGuestDelegate::RendererResponsive() {
-}
-
-void TestBrowserPluginGuestDelegate::RendererUnresponsive() {
-}
-
-void TestBrowserPluginGuestDelegate::RequestPermission(
- BrowserPluginPermissionType permission_type,
- const base::DictionaryValue& request_info,
- const PermissionResponseCallback& callback,
- bool allowed_by_default) {
-}
-
-void TestBrowserPluginGuestDelegate::SizeChanged(const gfx::Size& old_size,
- const gfx::Size& new_size) {
+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();
+ if (IsOverridingUserAgent()) {
+ load_url_params.override_user_agent =
+ NavigationController::UA_OVERRIDE_TRUE;
+ }
+ web_contents->GetController().LoadURLWithParams(load_url_params);
+}
+
+void TestBrowserPluginGuestDelegate::NavigateGuest(const std::string& src) {
+ GURL url(src);
+ LoadURLWithParams(url,
+ Referrer(),
+ PAGE_TRANSITION_AUTO_TOPLEVEL,
+ guest_->GetWebContents());
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698