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

Unified Diff: ios/web/public/test/test_web_client.mm

Issue 1043243003: Upstream most of ios/web/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove accidentally-added clients Created 5 years, 9 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
« no previous file with comments | « ios/web/public/test/test_web_client.h ('k') | ios/web/ui_web_view_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/test_web_client.mm
diff --git a/ios/web/public/test/test_web_client.mm b/ios/web/public/test/test_web_client.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d4b1e5c333ca6cbeef260c4cb0d9c3ed236f7717
--- /dev/null
+++ b/ios/web/public/test/test_web_client.mm
@@ -0,0 +1,41 @@
+// Copyright 2014 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.
+
+#import "ios/web/public/test/test_web_client.h"
+
+#include "base/strings/sys_string_conversions.h"
+
+namespace web {
+
+TestWebClient::TestWebClient()
+ : early_page_scripts_([[NSMutableDictionary alloc] init]) {
+}
+
+TestWebClient::~TestWebClient() {
+}
+
+std::string TestWebClient::GetUserAgent(bool desktop_user_agent) const {
+ return desktop_user_agent ? desktop_user_agent_ : user_agent_;
+}
+
+void TestWebClient::SetUserAgent(const std::string& user_agent,
+ bool is_desktop_user_agent) {
+ if (is_desktop_user_agent)
+ desktop_user_agent_ = user_agent;
+ else
+ user_agent_ = user_agent;
+}
+
+NSString* TestWebClient::GetEarlyPageScript(
+ web::WebViewType web_view_type) const {
+ NSString* result = [early_page_scripts_ objectForKey:@(web_view_type)];
+ return result ? result : @"";
+}
+
+void TestWebClient::SetEarlyPageScript(NSString* page_script,
+ web::WebViewType web_view_type) {
+ [early_page_scripts_ setObject:page_script forKey:@(web_view_type)];
+}
+
+} // namespace web
« no previous file with comments | « ios/web/public/test/test_web_client.h ('k') | ios/web/ui_web_view_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698