| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/public/cwv_web_view_configuration.h" | 5 #import "ios/web_view/public/cwv_web_view_configuration.h" |
| 6 #import "ios/web_view/internal/cwv_web_view_configuration_internal.h" | 6 #import "ios/web_view/internal/cwv_web_view_configuration_internal.h" |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "components/translate/core/browser/translate_download_manager.h" | |
| 11 #include "ios/web_view/internal/app/application_context.h" | 10 #include "ios/web_view/internal/app/application_context.h" |
| 12 #import "ios/web_view/internal/cwv_user_content_controller_internal.h" | 11 #import "ios/web_view/internal/cwv_user_content_controller_internal.h" |
| 13 #include "ios/web_view/internal/web_view_browser_state.h" | 12 #include "ios/web_view/internal/web_view_browser_state.h" |
| 14 #include "ios/web_view/internal/web_view_global_state_util.h" | 13 #include "ios/web_view/internal/web_view_global_state_util.h" |
| 15 | 14 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) | 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." | 16 #error "This file requires ARC support." |
| 18 #endif | 17 #endif |
| 19 | 18 |
| 20 @interface CWVWebViewConfiguration () { | 19 @interface CWVWebViewConfiguration () { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 self = [super init]; | 54 self = [super init]; |
| 56 if (self) { | 55 if (self) { |
| 57 _browserState = std::move(browserState); | 56 _browserState = std::move(browserState); |
| 58 | 57 |
| 59 _userContentController = | 58 _userContentController = |
| 60 [[CWVUserContentController alloc] initWithConfiguration:self]; | 59 [[CWVUserContentController alloc] initWithConfiguration:self]; |
| 61 } | 60 } |
| 62 return self; | 61 return self; |
| 63 } | 62 } |
| 64 | 63 |
| 64 #pragma mark - Public Methods |
| 65 |
| 65 - (BOOL)isPersistent { | 66 - (BOOL)isPersistent { |
| 66 return !_browserState->IsOffTheRecord(); | 67 return !_browserState->IsOffTheRecord(); |
| 67 } | 68 } |
| 68 | 69 |
| 70 #pragma mark - Private Methods |
| 71 |
| 69 - (ios_web_view::WebViewBrowserState*)browserState { | 72 - (ios_web_view::WebViewBrowserState*)browserState { |
| 70 return _browserState.get(); | 73 return _browserState.get(); |
| 71 } | 74 } |
| 72 | 75 |
| 73 @end | 76 @end |
| OLD | NEW |