Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: ios/chrome/browser/ui/external_file_controller.mm

Issue 2804703002: [ObjC ARC] Converts ios/chrome/browser/ui:ui_internal_arc to ARC. (Closed)
Patch Set: comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/chrome_web_view_factory.mm ('k') | ios/chrome/browser/ui/external_file_remover.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/external_file_controller.mm
diff --git a/ios/chrome/browser/ui/external_file_controller.mm b/ios/chrome/browser/ui/external_file_controller.mm
index 1ea3a79e619fa7f115a5c4f031395184056c8967..51c52029b2bf5acb8f84b5aeec22de5fb939e5ff 100644
--- a/ios/chrome/browser/ui/external_file_controller.mm
+++ b/ios/chrome/browser/ui/external_file_controller.mm
@@ -7,12 +7,15 @@
#import <WebKit/WebKit.h>
#include "base/logging.h"
-#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#import "ios/chrome/browser/tabs/tab_model.h"
#import "ios/web/public/web_view_creation_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// The path relative to the <Application_Home>/Documents/ directory where the
@@ -30,20 +33,19 @@ const CFTimeInterval kSecondsPerDay = 60 * 60 * 24;
@end
@implementation ExternalFileController {
- base::scoped_nsobject<WKWebView> _webView;
+ WKWebView* _webView;
}
- (instancetype)initWithURL:(const GURL&)URL
browserState:(web::BrowserState*)browserState {
self = [super initWithURL:URL];
if (self) {
- _webView.reset([web::BuildWKWebView(CGRectZero, browserState) retain]);
+ _webView = web::BuildWKWebView(CGRectZero, browserState);
[_webView setBackgroundColor:[UIColor whiteColor]];
[_webView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight)];
[_webView setUserInteractionEnabled:YES];
- base::scoped_nsobject<UIView> view(
- [[UIView alloc] initWithFrame:CGRectZero]);
+ UIView* view = [[UIView alloc] initWithFrame:CGRectZero];
self.view = view;
[self.view addSubview:_webView];
[self.view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth |
@@ -116,7 +118,6 @@ const CFTimeInterval kSecondsPerDay = 60 * 60 * 24;
- (void)dealloc {
[_webView removeFromSuperview];
- [super dealloc];
}
@end
« no previous file with comments | « ios/chrome/browser/ui/chrome_web_view_factory.mm ('k') | ios/chrome/browser/ui/external_file_remover.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698