| 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/web_state/web_view_internal_creation_util.h" | 5 #import "ios/web/web_state/web_view_internal_creation_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "ios/web/public/web_client.h" | 9 #include "ios/web/public/web_client.h" |
| 10 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" | 10 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" |
| 11 | 11 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." |
| 14 #endif |
| 15 |
| 12 namespace web { | 16 namespace web { |
| 13 | 17 |
| 14 namespace { | 18 namespace { |
| 15 | 19 |
| 16 // Verifies the preconditions for creating a WKWebView. Must be called before | 20 // Verifies the preconditions for creating a WKWebView. Must be called before |
| 17 // a WKWebView is allocated. Not verifying the preconditions before creating | 21 // a WKWebView is allocated. Not verifying the preconditions before creating |
| 18 // a WKWebView will lead to undefined behavior. | 22 // a WKWebView will lead to undefined behavior. |
| 19 void VerifyWKWebViewCreationPreConditions( | 23 void VerifyWKWebViewCreationPreConditions( |
| 20 BrowserState* browser_state, | 24 BrowserState* browser_state, |
| 21 WKWebViewConfiguration* configuration) { | 25 WKWebViewConfiguration* configuration) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 62 |
| 59 WKWebView* CreateWKWebView(CGRect frame, | 63 WKWebView* CreateWKWebView(CGRect frame, |
| 60 WKWebViewConfiguration* configuration, | 64 WKWebViewConfiguration* configuration, |
| 61 BrowserState* browser_state) { | 65 BrowserState* browser_state) { |
| 62 BOOL use_desktop_user_agent = NO; | 66 BOOL use_desktop_user_agent = NO; |
| 63 return CreateWKWebView(frame, configuration, browser_state, | 67 return CreateWKWebView(frame, configuration, browser_state, |
| 64 use_desktop_user_agent); | 68 use_desktop_user_agent); |
| 65 } | 69 } |
| 66 | 70 |
| 67 } // namespace web | 71 } // namespace web |
| OLD | NEW |