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

Unified Diff: ios/chrome/browser/ui/main/browser_view_wrangler.mm

Issue 2886043003: [ObjC ARC] Converts ios/chrome/browser/ui/main:main to ARC. (Closed)
Patch Set: comments Created 3 years, 6 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/main/BUILD.gn ('k') | ios/chrome/browser/ui/main/main_coordinator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/main/browser_view_wrangler.mm
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
index accb6c1a6749f8ecf427a9499bef2c1530f03e73..bae8fb0b1738d92b4c22abb19f27ba7c5abb6517 100644
--- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm
+++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -4,8 +4,6 @@
#import "ios/chrome/browser/ui/main/browser_view_wrangler.h"
-#include "base/mac/objc_property_releaser.h"
-#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
@@ -24,17 +22,19 @@
#import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@interface BrowserViewWrangler ()<TabModelObserver> {
ios::ChromeBrowserState* _browserState;
__unsafe_unretained id<TabModelObserver> _tabModelObserver;
BOOL _isShutdown;
-
- base::mac::ObjCPropertyReleaser _propertyReleaser_BrowserViewWrangler;
}
// Responsible for maintaining all state related to sharing to other devices.
// Redeclared readwrite from the readonly declaration in the Testing interface.
-@property(nonatomic, retain, readwrite)
+@property(nonatomic, strong, readwrite)
DeviceSharingManager* deviceSharingManager;
// Creates a new autoreleased tab model for |browserState|; if |empty| is NO,
@@ -69,8 +69,6 @@
- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
tabModelObserver:(id<TabModelObserver>)tabModelObserver {
if ((self = [super init])) {
- _propertyReleaser_BrowserViewWrangler.Init(self,
- [BrowserViewWrangler class]);
_browserState = browserState;
_tabModelObserver = tabModelObserver;
}
@@ -84,7 +82,6 @@
- (void)dealloc {
DCHECK(_isShutdown) << "-shutdown must be called before -dealloc";
- [super dealloc];
}
#pragma mark - BrowserViewInformation property implementations
@@ -108,10 +105,9 @@
if (_mainBVC) {
[_mainBVC browserStateDestroyed];
[_mainBVC shutdown];
- [_mainBVC autorelease];
}
- _mainBVC = [mainBVC retain];
+ _mainBVC = mainBVC;
}
- (TabModel*)mainTabModel {
@@ -135,10 +131,9 @@
[_mainTabModel removeObserver:_tabModelObserver];
}
[_mainTabModel removeObserver:self];
- [_mainTabModel autorelease];
}
- _mainTabModel = [mainTabModel retain];
+ _mainTabModel = mainTabModel;
}
- (BrowserViewController*)otrBVC {
@@ -163,10 +158,9 @@
if (_otrBVC) {
[_otrBVC browserStateDestroyed];
[_otrBVC shutdown];
- [_otrBVC autorelease];
}
- _otrBVC = [otrBVC retain];
+ _otrBVC = otrBVC;
}
- (TabModel*)otrTabModel {
@@ -186,10 +180,9 @@
[_otrTabModel removeObserver:_tabModelObserver];
}
[_otrTabModel removeObserver:self];
- [_otrTabModel autorelease];
}
- _otrTabModel = [otrTabModel retain];
+ _otrTabModel = otrTabModel;
}
- (void)setCurrentBVC:(BrowserViewController*)bvc
@@ -259,8 +252,7 @@
- (void)updateDeviceSharingManager {
if (!self.deviceSharingManager) {
- self.deviceSharingManager =
- [[[DeviceSharingManager alloc] init] autorelease];
+ self.deviceSharingManager = [[DeviceSharingManager alloc] init];
}
[self.deviceSharingManager updateBrowserState:_browserState];
@@ -375,9 +367,9 @@
// Create tab model from saved session (nil is ok).
TabModel* tabModel =
- [[[TabModel alloc] initWithSessionWindow:sessionWindow
- sessionService:[SessionServiceIOS sharedService]
- browserState:browserState] autorelease];
+ [[TabModel alloc] initWithSessionWindow:sessionWindow
+ sessionService:[SessionServiceIOS sharedService]
+ browserState:browserState];
// Add observers.
if (_tabModelObserver) {
[tabModel addObserver:_tabModelObserver];
@@ -391,12 +383,12 @@
- (BrowserViewController*)bvcForBrowserState:
(ios::ChromeBrowserState*)browserState
tabModel:(TabModel*)tabModel {
- base::scoped_nsobject<BrowserViewControllerDependencyFactory> factory(
+ BrowserViewControllerDependencyFactory* factory =
[[BrowserViewControllerDependencyFactory alloc]
- initWithBrowserState:browserState]);
- return [[[BrowserViewController alloc] initWithTabModel:tabModel
- browserState:browserState
- dependencyFactory:factory] autorelease];
+ initWithBrowserState:browserState];
+ return [[BrowserViewController alloc] initWithTabModel:tabModel
+ browserState:browserState
+ dependencyFactory:factory];
}
@end
« no previous file with comments | « ios/chrome/browser/ui/main/BUILD.gn ('k') | ios/chrome/browser/ui/main/main_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698