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/web_view_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/web_view_browser_state.h" | 9 #include "ios/web_view/internal/web_view_browser_state.h" |
| 10 #import "ios/web_view/internal/web_view_early_page_script_provider.h" |
10 #import "ios/web_view/internal/web_view_web_main_parts.h" | 11 #import "ios/web_view/internal/web_view_web_main_parts.h" |
11 #import "ios/web_view/public/cwv_delegate.h" | 12 #import "ios/web_view/public/cwv_delegate.h" |
12 | 13 |
13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
14 #error "This file requires ARC support." | 15 #error "This file requires ARC support." |
15 #endif | 16 #endif |
16 | 17 |
17 namespace ios_web_view { | 18 namespace ios_web_view { |
18 | 19 |
19 WebViewWebClient::WebViewWebClient(id<CWVDelegate> delegate) | 20 WebViewWebClient::WebViewWebClient(id<CWVDelegate> delegate) |
(...skipping 15 matching lines...) Expand all Loading... |
35 } | 36 } |
36 | 37 |
37 std::string WebViewWebClient::GetProduct() const { | 38 std::string WebViewWebClient::GetProduct() const { |
38 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); | 39 return base::SysNSStringToUTF8([delegate_ partialUserAgent]); |
39 } | 40 } |
40 | 41 |
41 std::string WebViewWebClient::GetUserAgent(web::UserAgentType type) const { | 42 std::string WebViewWebClient::GetUserAgent(web::UserAgentType type) const { |
42 return web::BuildUserAgentFromProduct(GetProduct()); | 43 return web::BuildUserAgentFromProduct(GetProduct()); |
43 } | 44 } |
44 | 45 |
| 46 NSString* WebViewWebClient::GetEarlyPageScript( |
| 47 web::BrowserState* browser_state) const { |
| 48 return WebViewEarlyPageScriptProvider::FromBrowserState(browser_state) |
| 49 .GetScript(); |
| 50 } |
| 51 |
45 } // namespace ios_web_view | 52 } // namespace ios_web_view |
OLD | NEW |