| 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/public/criwv_web_view.h" | 5 #import "ios/web_view/public/cwv_web_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
| 13 #import "ios/web/public/navigation_manager.h" | 13 #import "ios/web/public/navigation_manager.h" |
| 14 #include "ios/web/public/referrer.h" | 14 #include "ios/web/public/referrer.h" |
| 15 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" | 15 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
| 16 #import "ios/web/public/web_state/ui/crw_web_delegate.h" | 16 #import "ios/web/public/web_state/ui/crw_web_delegate.h" |
| 17 #import "ios/web/public/web_state/web_state.h" | 17 #import "ios/web/public/web_state/web_state.h" |
| 18 #import "ios/web/public/web_state/web_state_delegate_bridge.h" | 18 #import "ios/web/public/web_state/web_state_delegate_bridge.h" |
| 19 #import "ios/web/public/web_state/web_state_observer_bridge.h" | 19 #import "ios/web/public/web_state/web_state_observer_bridge.h" |
| 20 #include "ios/web_view/internal/criwv_browser_state.h" | 20 #include "ios/web_view/internal/criwv_browser_state.h" |
| 21 #import "ios/web_view/internal/criwv_website_data_store_internal.h" | 21 #import "ios/web_view/internal/criwv_website_data_store_internal.h" |
| 22 #import "ios/web_view/internal/translate/criwv_translate_client.h" | 22 #import "ios/web_view/internal/translate/criwv_translate_client.h" |
| 23 #import "ios/web_view/public/criwv_web_view_configuration.h" | 23 #import "ios/web_view/public/criwv_web_view_configuration.h" |
| 24 #import "ios/web_view/public/criwv_web_view_delegate.h" | 24 #import "ios/web_view/public/criwv_web_view_delegate.h" |
| 25 #import "ios/web_view/public/criwv_website_data_store.h" | 25 #import "ios/web_view/public/criwv_website_data_store.h" |
| 26 #import "net/base/mac/url_conversions.h" | 26 #import "net/base/mac/url_conversions.h" |
| 27 #include "ui/base/page_transition_types.h" | 27 #include "ui/base/page_transition_types.h" |
| 28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| 29 | 29 |
| 30 #if !defined(__has_feature) || !__has_feature(objc_arc) | 30 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 31 #error "This file requires ARC support." | 31 #error "This file requires ARC support." |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 @interface CRIWVWebView ()<CRWWebStateDelegate, CRWWebStateObserver> { | 34 @interface CWVWebView ()<CRWWebStateDelegate, CRWWebStateObserver> { |
| 35 CRIWVWebViewConfiguration* _configuration; | 35 CRIWVWebViewConfiguration* _configuration; |
| 36 std::unique_ptr<web::WebState> _webState; | 36 std::unique_ptr<web::WebState> _webState; |
| 37 std::unique_ptr<web::WebStateDelegateBridge> _webStateDelegate; | 37 std::unique_ptr<web::WebStateDelegateBridge> _webStateDelegate; |
| 38 std::unique_ptr<web::WebStateObserverBridge> _webStateObserver; | 38 std::unique_ptr<web::WebStateObserverBridge> _webStateObserver; |
| 39 CGFloat _loadProgress; | 39 CGFloat _loadProgress; |
| 40 } | 40 } |
| 41 | 41 |
| 42 @end | 42 @end |
| 43 | 43 |
| 44 @implementation CRIWVWebView | 44 @implementation CWVWebView |
| 45 | 45 |
| 46 @synthesize delegate = _delegate; | 46 @synthesize delegate = _delegate; |
| 47 @synthesize loadProgress = _loadProgress; | 47 @synthesize loadProgress = _loadProgress; |
| 48 | 48 |
| 49 - (instancetype)initWithFrame:(CGRect)frame | 49 - (instancetype)initWithFrame:(CGRect)frame |
| 50 configuration:(CRIWVWebViewConfiguration*)configuration { | 50 configuration:(CRIWVWebViewConfiguration*)configuration { |
| 51 self = [super initWithFrame:frame]; | 51 self = [super initWithFrame:frame]; |
| 52 if (self) { | 52 if (self) { |
| 53 _configuration = [configuration copy]; | 53 _configuration = [configuration copy]; |
| 54 | 54 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 loadSuccess:success]; | 179 loadSuccess:success]; |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 - (void)webState:(web::WebState*)webState | 183 - (void)webState:(web::WebState*)webState |
| 184 didChangeLoadingProgress:(double)progress { | 184 didChangeLoadingProgress:(double)progress { |
| 185 [self notifyDidUpdateWithChanges:CRIWVWebViewUpdateTypeProgress]; | 185 [self notifyDidUpdateWithChanges:CRIWVWebViewUpdateTypeProgress]; |
| 186 } | 186 } |
| 187 | 187 |
| 188 @end | 188 @end |
| OLD | NEW |