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/public/web_view_creation_util.h" | 5 #import "ios/web/public/web_view_creation_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ios/web/public/user_agent.h" | |
9 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" | 8 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" |
10 #import "ios/web/web_state/web_view_internal_creation_util.h" | 9 #import "ios/web/web_state/web_view_internal_creation_util.h" |
11 | 10 |
12 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
13 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
14 #endif | 13 #endif |
15 | 14 |
16 namespace web { | 15 namespace web { |
17 | 16 |
18 WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state) { | 17 WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state) { |
19 return BuildWKWebViewWithCustomContextMenu(frame, browser_state, nil); | 18 return BuildWKWebViewWithCustomContextMenu(frame, browser_state, nil); |
20 } | 19 } |
21 | 20 |
22 WKWebView* BuildWKWebViewWithCustomContextMenu( | 21 WKWebView* BuildWKWebViewWithCustomContextMenu( |
23 CGRect frame, | 22 CGRect frame, |
24 BrowserState* browser_state, | 23 BrowserState* browser_state, |
25 id<CRWContextMenuDelegate> context_menu_delegate) { | 24 id<CRWContextMenuDelegate> context_menu_delegate) { |
26 DCHECK(browser_state); | 25 DCHECK(browser_state); |
27 | 26 |
28 WKWebViewConfigurationProvider& config_provider = | 27 WKWebViewConfigurationProvider& config_provider = |
29 WKWebViewConfigurationProvider::FromBrowserState(browser_state); | 28 WKWebViewConfigurationProvider::FromBrowserState(browser_state); |
30 return BuildWKWebView(frame, config_provider.GetWebViewConfiguration(), | 29 return BuildWKWebView(frame, config_provider.GetWebViewConfiguration(), |
31 browser_state, UserAgentType::MOBILE, | 30 browser_state, NO, context_menu_delegate); |
32 context_menu_delegate); | |
33 } | 31 } |
34 | 32 |
35 } // namespace web | 33 } // namespace web |
OLD | NEW |