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

Side by Side Diff: ios/web_view/internal/criwv_web_client.mm

Issue 2679003002: Initialize CRIWVWebView with Configuration object instead of browserState. (Closed)
Patch Set: Rebase. Respond to comments. Fix duplicate unique_ptr. Created 3 years, 10 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
« no previous file with comments | « ios/web_view/internal/criwv_web_client.h ('k') | ios/web_view/internal/criwv_web_main_parts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #import "ios/web_view/internal/criwv_web_client.h" 5 #import "ios/web_view/internal/criwv_web_client.h"
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #include "ios/web/public/user_agent.h" 8 #include "ios/web/public/user_agent.h"
9 #include "ios/web_view/internal/criwv_browser_state.h" 9 #include "ios/web_view/internal/criwv_browser_state.h"
10 #import "ios/web_view/internal/criwv_web_main_parts.h" 10 #import "ios/web_view/internal/criwv_web_main_parts.h"
11 #import "ios/web_view/public/criwv_delegate.h" 11 #import "ios/web_view/public/criwv_delegate.h"
12 12
13 namespace ios_web_view { 13 namespace ios_web_view {
14 14
15 CRIWVWebClient::CRIWVWebClient(id<CRIWVDelegate> delegate) 15 CRIWVWebClient::CRIWVWebClient(id<CRIWVDelegate> delegate)
16 : delegate_(delegate), web_main_parts_(nullptr) {} 16 : delegate_(delegate), web_main_parts_(nullptr) {}
17 17
18 CRIWVWebClient::~CRIWVWebClient() {} 18 CRIWVWebClient::~CRIWVWebClient() {}
19 19
20 web::WebMainParts* CRIWVWebClient::CreateWebMainParts() { 20 web::WebMainParts* CRIWVWebClient::CreateWebMainParts() {
21 web_main_parts_ = new CRIWVWebMainParts(delegate_); 21 web_main_parts_ = new CRIWVWebMainParts(delegate_);
22 return web_main_parts_; 22 return web_main_parts_;
23 } 23 }
24 24
25 CRIWVBrowserState* CRIWVWebClient::browser_state() const { 25 CRIWVBrowserState* CRIWVWebClient::browser_state() const {
26 return web_main_parts_->browser_state(); 26 return web_main_parts_->browser_state();
27 } 27 }
28 28
29 CRIWVBrowserState* CRIWVWebClient::off_the_record_browser_state() const {
30 return web_main_parts_->off_the_record_browser_state();
31 }
32
29 std::string CRIWVWebClient::GetProduct() const { 33 std::string CRIWVWebClient::GetProduct() const {
30 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); 34 return base::SysNSStringToUTF8([delegate_ partialUserAgent]);
31 } 35 }
32 36
33 std::string CRIWVWebClient::GetUserAgent(bool desktop_user_agent) const { 37 std::string CRIWVWebClient::GetUserAgent(bool desktop_user_agent) const {
34 std::string product = GetProduct(); 38 std::string product = GetProduct();
35 return web::BuildUserAgentFromProduct(product); 39 return web::BuildUserAgentFromProduct(product);
36 } 40 }
37 41
38 } // namespace ios_web_view 42 } // namespace ios_web_view
OLDNEW
« no previous file with comments | « ios/web_view/internal/criwv_web_client.h ('k') | ios/web_view/internal/criwv_web_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698