| OLD | NEW |
| (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_view/internal/criwv_web_client.h" |
| 6 |
| 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "ios/web/public/user_agent.h" |
| 9 #include "ios/web_view/internal/criwv_browser_state.h" |
| 10 #import "ios/web_view/internal/criwv_web_main_parts.h" |
| 11 #import "ios/web_view/public/criwv_delegate.h" |
| 12 |
| 13 namespace ios_web_view { |
| 14 |
| 15 CRIWVWebClient::CRIWVWebClient(id<CRIWVDelegate> delegate) |
| 16 : delegate_(delegate), |
| 17 web_main_parts_(nullptr) {} |
| 18 |
| 19 CRIWVWebClient::~CRIWVWebClient() {} |
| 20 |
| 21 web::WebMainParts* CRIWVWebClient::CreateWebMainParts() { |
| 22 web_main_parts_ = new CRIWVWebMainParts(delegate_); |
| 23 return web_main_parts_; |
| 24 } |
| 25 |
| 26 CRIWVBrowserState* CRIWVWebClient::browser_state() const { |
| 27 return web_main_parts_->browser_state(); |
| 28 } |
| 29 |
| 30 std::string CRIWVWebClient::GetProduct() const { |
| 31 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); |
| 32 } |
| 33 |
| 34 std::string CRIWVWebClient::GetUserAgent(bool desktop_user_agent) const { |
| 35 std::string product = GetProduct(); |
| 36 return web::BuildUserAgentFromProduct(product); |
| 37 } |
| 38 |
| 39 } // namespace ios_web_view |
| OLD | NEW |