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

Side by Side 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: Created 5 years, 8 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 2014 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 #import "ios/web/public/test/test_web_client.h"
6
7 #include "base/strings/sys_string_conversions.h"
8
9 namespace web {
10
11 TestWebClient::TestWebClient()
12 : early_page_scripts_([[NSMutableDictionary alloc] init]) {
13 }
14
15 TestWebClient::~TestWebClient() {
16 }
17
18 std::string TestWebClient::GetUserAgent(bool desktop_user_agent) const {
19 return desktop_user_agent ? desktop_user_agent_ : user_agent_;
20 }
21
22 void TestWebClient::SetUserAgent(const std::string& user_agent,
23 bool is_desktop_user_agent) {
24 if (is_desktop_user_agent)
25 desktop_user_agent_ = user_agent;
26 else
27 user_agent_ = user_agent;
28 }
29
30 NSString* TestWebClient::GetEarlyPageScript(
31 web::WebViewType web_view_type) const {
32 NSString* result = [early_page_scripts_ objectForKey:@(web_view_type)];
33 return result ? result : @"";
34 }
35
36 void TestWebClient::SetEarlyPageScript(NSString* page_script,
37 web::WebViewType web_view_type) {
38 [early_page_scripts_ setObject:page_script forKey:@(web_view_type)];
39 }
40
41 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698