OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/chrome/browser/ui/chrome_web_view_factory.h" | 5 #import "ios/chrome/browser/ui/chrome_web_view_factory.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/scoped_nsobject.h" | |
10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 9 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
11 #include "ios/web/net/request_group_util.h" | 10 #include "ios/web/net/request_group_util.h" |
12 #include "ios/web/net/request_tracker_impl.h" | 11 #include "ios/web/net/request_tracker_impl.h" |
13 #include "ios/web/public/web_thread.h" | 12 #include "ios/web/public/web_thread.h" |
14 #include "net/cookies/cookie_store.h" | 13 #include "net/cookies/cookie_store.h" |
15 #include "net/url_request/url_request_context.h" | 14 #include "net/url_request/url_request_context.h" |
16 #include "net/url_request/url_request_context_getter.h" | 15 #include "net/url_request/url_request_context_getter.h" |
17 | 16 |
| 17 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 18 #error "This file requires ARC support." |
| 19 #endif |
| 20 |
18 NSString* const kExternalUserAgent = @"UIWebViewForExternalContent"; | 21 NSString* const kExternalUserAgent = @"UIWebViewForExternalContent"; |
19 | 22 |
20 namespace ChromeWebView { | 23 namespace ChromeWebView { |
21 // Shared desktop user agent used to mimic Safari on a mac. | 24 // Shared desktop user agent used to mimic Safari on a mac. |
22 NSString* const kDesktopUserAgent = | 25 NSString* const kDesktopUserAgent = |
23 @"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) " | 26 @"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) " |
24 @"AppleWebKit/600.7.12 (KHTML, like Gecko) " | 27 @"AppleWebKit/600.7.12 (KHTML, like Gecko) " |
25 @"Version/8.0.7 " | 28 @"Version/8.0.7 " |
26 @"Safari/600.7.12"; | 29 @"Safari/600.7.12"; |
27 | 30 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (!g_request_tracker.get()) { | 157 if (!g_request_tracker.get()) { |
155 DCHECK(g_external_browser_state); | 158 DCHECK(g_external_browser_state); |
156 g_request_tracker = web::RequestTrackerImpl::CreateTrackerForRequestGroupID( | 159 g_request_tracker = web::RequestTrackerImpl::CreateTrackerForRequestGroupID( |
157 ChromeWebView::kExternalRequestGroupID, g_external_browser_state, | 160 ChromeWebView::kExternalRequestGroupID, g_external_browser_state, |
158 [self requestContextForExternalService:externalService], nil); | 161 [self requestContextForExternalService:externalService], nil); |
159 } | 162 } |
160 return [[UIWebView alloc] initWithFrame:CGRectZero]; | 163 return [[UIWebView alloc] initWithFrame:CGRectZero]; |
161 } | 164 } |
162 | 165 |
163 @end | 166 @end |
OLD | NEW |