| OLD | NEW |
| 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/web_view_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/web_view_browser_state.h" |
| 10 #import "ios/web_view/internal/criwv_web_main_parts.h" | 10 #import "ios/web_view/internal/web_view_web_main_parts.h" |
| 11 #import "ios/web_view/public/cwv_delegate.h" | 11 #import "ios/web_view/public/cwv_delegate.h" |
| 12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." | 14 #error "This file requires ARC support." |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace ios_web_view { | 17 namespace ios_web_view { |
| 18 | 18 |
| 19 CRIWVWebClient::CRIWVWebClient(id<CWVDelegate> delegate) | 19 WebViewWebClient::WebViewWebClient(id<CWVDelegate> delegate) |
| 20 : delegate_(delegate), web_main_parts_(nullptr) {} | 20 : delegate_(delegate), web_main_parts_(nullptr) {} |
| 21 | 21 |
| 22 CRIWVWebClient::~CRIWVWebClient() {} | 22 WebViewWebClient::~WebViewWebClient() = default; |
| 23 | 23 |
| 24 web::WebMainParts* CRIWVWebClient::CreateWebMainParts() { | 24 web::WebMainParts* WebViewWebClient::CreateWebMainParts() { |
| 25 web_main_parts_ = new CRIWVWebMainParts(delegate_); | 25 web_main_parts_ = new WebViewWebMainParts(delegate_); |
| 26 return web_main_parts_; | 26 return web_main_parts_; |
| 27 } | 27 } |
| 28 | 28 |
| 29 CRIWVBrowserState* CRIWVWebClient::browser_state() const { | 29 WebViewBrowserState* WebViewWebClient::browser_state() const { |
| 30 return web_main_parts_->browser_state(); | 30 return web_main_parts_->browser_state(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 CRIWVBrowserState* CRIWVWebClient::off_the_record_browser_state() const { | 33 WebViewBrowserState* WebViewWebClient::off_the_record_browser_state() const { |
| 34 return web_main_parts_->off_the_record_browser_state(); | 34 return web_main_parts_->off_the_record_browser_state(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::string CRIWVWebClient::GetProduct() const { | 37 std::string WebViewWebClient::GetProduct() const { |
| 38 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); | 38 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); |
| 39 } | 39 } |
| 40 | 40 |
| 41 std::string CRIWVWebClient::GetUserAgent(bool desktop_user_agent) const { | 41 std::string WebViewWebClient::GetUserAgent(bool desktop_user_agent) const { |
| 42 std::string product = GetProduct(); | 42 return web::BuildUserAgentFromProduct(GetProduct()); |
| 43 return web::BuildUserAgentFromProduct(product); | |
| 44 } | 43 } |
| 45 | 44 |
| 46 } // namespace ios_web_view | 45 } // namespace ios_web_view |
| OLD | NEW |