| 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/cwv_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" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 UIView* subview = _webState->GetView(); | 94 UIView* subview = _webState->GetView(); |
| 95 if (subview.superview == self) { | 95 if (subview.superview == self) { |
| 96 return; | 96 return; |
| 97 } | 97 } |
| 98 subview.frame = self.frame; | 98 subview.frame = self.frame; |
| 99 subview.autoresizingMask = | 99 subview.autoresizingMask = |
| 100 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | 100 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; |
| 101 [self addSubview:subview]; | 101 [self addSubview:subview]; |
| 102 } | 102 } |
| 103 | 103 |
| 104 - (UIView*)view { | |
| 105 return _webState->GetView(); | |
| 106 } | |
| 107 | |
| 108 - (BOOL)canGoBack { | 104 - (BOOL)canGoBack { |
| 109 return _webState && _webState->GetNavigationManager()->CanGoBack(); | 105 return _webState && _webState->GetNavigationManager()->CanGoBack(); |
| 110 } | 106 } |
| 111 | 107 |
| 112 - (BOOL)canGoForward { | 108 - (BOOL)canGoForward { |
| 113 return _webState && _webState->GetNavigationManager()->CanGoForward(); | 109 return _webState && _webState->GetNavigationManager()->CanGoForward(); |
| 114 } | 110 } |
| 115 | 111 |
| 116 - (BOOL)isLoading { | 112 - (BOOL)isLoading { |
| 117 return _webState->IsLoading(); | 113 return _webState->IsLoading(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 [_UIDelegate webViewDidClose:self]; | 262 [_UIDelegate webViewDidClose:self]; |
| 267 } | 263 } |
| 268 } | 264 } |
| 269 | 265 |
| 270 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: | 266 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: |
| 271 (web::WebState*)webState { | 267 (web::WebState*)webState { |
| 272 return _javaScriptDialogPresenter.get(); | 268 return _javaScriptDialogPresenter.get(); |
| 273 } | 269 } |
| 274 | 270 |
| 275 @end | 271 @end |
| OLD | NEW |