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

Side by Side Diff: ios/chrome/browser/ui/main/browser_view_wrangler.mm

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: Rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chrome/browser/ui/main/browser_view_wrangler.h" 5 #import "ios/chrome/browser/ui/main/browser_view_wrangler.h"
6 6
7 #include "base/mac/objc_property_releaser.h" 7 #include "base/mac/objc_release_properties.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "ios/chrome/browser/application_context.h" 10 #include "ios/chrome/browser/application_context.h"
11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
12 #import "ios/chrome/browser/browsing_data/browsing_data_removal_controller.h" 12 #import "ios/chrome/browser/browsing_data/browsing_data_removal_controller.h"
13 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" 13 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h"
14 #include "ios/chrome/browser/crash_report/crash_report_helper.h" 14 #include "ios/chrome/browser/crash_report/crash_report_helper.h"
15 #import "ios/chrome/browser/device_sharing/device_sharing_manager.h" 15 #import "ios/chrome/browser/device_sharing/device_sharing_manager.h"
16 #import "ios/chrome/browser/physical_web/start_physical_web_discovery.h" 16 #import "ios/chrome/browser/physical_web/start_physical_web_discovery.h"
17 #import "ios/chrome/browser/sessions/session_ios.h" 17 #import "ios/chrome/browser/sessions/session_ios.h"
18 #import "ios/chrome/browser/sessions/session_service_ios.h" 18 #import "ios/chrome/browser/sessions/session_service_ios.h"
19 #import "ios/chrome/browser/sessions/session_window_ios.h" 19 #import "ios/chrome/browser/sessions/session_window_ios.h"
20 #import "ios/chrome/browser/tabs/tab.h" 20 #import "ios/chrome/browser/tabs/tab.h"
21 #import "ios/chrome/browser/tabs/tab_model.h" 21 #import "ios/chrome/browser/tabs/tab_model.h"
22 #import "ios/chrome/browser/tabs/tab_model_observer.h" 22 #import "ios/chrome/browser/tabs/tab_model_observer.h"
23 #import "ios/chrome/browser/ui/browser_view_controller.h" 23 #import "ios/chrome/browser/ui/browser_view_controller.h"
24 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" 24 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h"
25 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 25 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
26 26
27 @interface BrowserViewWrangler ()<TabModelObserver> { 27 @interface BrowserViewWrangler ()<TabModelObserver> {
28 ios::ChromeBrowserState* _browserState; 28 ios::ChromeBrowserState* _browserState;
29 __unsafe_unretained id<TabModelObserver> _tabModelObserver; 29 __unsafe_unretained id<TabModelObserver> _tabModelObserver;
30
31 base::mac::ObjCPropertyReleaser _propertyReleaser_BrowserViewWrangler;
32 } 30 }
33 31
34 // Responsible for maintaining all state related to sharing to other devices. 32 // Responsible for maintaining all state related to sharing to other devices.
35 // Redeclared readwrite from the readonly declaration in the Testing interface. 33 // Redeclared readwrite from the readonly declaration in the Testing interface.
36 @property(nonatomic, retain, readwrite) 34 @property(nonatomic, retain, readwrite)
37 DeviceSharingManager* deviceSharingManager; 35 DeviceSharingManager* deviceSharingManager;
38 36
39 // Creates a new autoreleased tab model for |browserState|; if |empty| is NO, 37 // Creates a new autoreleased tab model for |browserState|; if |empty| is NO,
40 // then any existing tabs that have been saved for |browserState| will be 38 // then any existing tabs that have been saved for |browserState| will be
41 // loaded; otherwise, the tab model will be created empty. 39 // loaded; otherwise, the tab model will be created empty.
(...skipping 19 matching lines...) Expand all
61 @synthesize mainTabModel = _mainTabModel; 59 @synthesize mainTabModel = _mainTabModel;
62 @synthesize otrBVC = _otrBVC; 60 @synthesize otrBVC = _otrBVC;
63 @synthesize otrTabModel = _otrTabModel; 61 @synthesize otrTabModel = _otrTabModel;
64 @synthesize currentBVC = _currentBVC; 62 @synthesize currentBVC = _currentBVC;
65 // Private properies. 63 // Private properies.
66 @synthesize deviceSharingManager = _deviceSharingManager; 64 @synthesize deviceSharingManager = _deviceSharingManager;
67 65
68 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState 66 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
69 tabModelObserver:(id<TabModelObserver>)tabModelObserver { 67 tabModelObserver:(id<TabModelObserver>)tabModelObserver {
70 if ((self = [super init])) { 68 if ((self = [super init])) {
71 _propertyReleaser_BrowserViewWrangler.Init(self,
72 [BrowserViewWrangler class]);
73 _browserState = browserState; 69 _browserState = browserState;
74 _tabModelObserver = tabModelObserver; 70 _tabModelObserver = tabModelObserver;
75 } 71 }
76 return self; 72 return self;
77 } 73 }
78 74
79 - (instancetype)init { 75 - (instancetype)init {
80 NOTREACHED(); 76 NOTREACHED();
81 return nil; 77 return nil;
82 } 78 }
(...skipping 11 matching lines...) Expand all
94 90
95 // Stop Breakpad state monitoring of both tab models (if necessary). 91 // Stop Breakpad state monitoring of both tab models (if necessary).
96 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel); 92 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel);
97 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel); 93 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel);
98 94
99 // Normally other objects will take care of unhooking the tab models from 95 // Normally other objects will take care of unhooking the tab models from
100 // the browser state, but this code should ensure that it happens regardless. 96 // the browser state, but this code should ensure that it happens regardless.
101 [_mainTabModel browserStateDestroyed]; 97 [_mainTabModel browserStateDestroyed];
102 [_otrTabModel browserStateDestroyed]; 98 [_otrTabModel browserStateDestroyed];
103 99
100 base::mac::ReleaseProperties(self);
104 [super dealloc]; 101 [super dealloc];
105 } 102 }
106 103
107 #pragma mark - BrowserViewInformation property implementations 104 #pragma mark - BrowserViewInformation property implementations
108 105
109 - (BrowserViewController*)mainBVC { 106 - (BrowserViewController*)mainBVC {
110 if (!_mainBVC) { 107 if (!_mainBVC) {
111 // |_browserState| should always be set before trying to create 108 // |_browserState| should always be set before trying to create
112 // |_mainBVC|. 109 // |_mainBVC|.
113 DCHECK(_browserState); 110 DCHECK(_browserState);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 tabModel:(TabModel*)tabModel { 326 tabModel:(TabModel*)tabModel {
330 base::scoped_nsobject<BrowserViewControllerDependencyFactory> factory( 327 base::scoped_nsobject<BrowserViewControllerDependencyFactory> factory(
331 [[BrowserViewControllerDependencyFactory alloc] 328 [[BrowserViewControllerDependencyFactory alloc]
332 initWithBrowserState:browserState]); 329 initWithBrowserState:browserState]);
333 return [[[BrowserViewController alloc] initWithTabModel:tabModel 330 return [[[BrowserViewController alloc] initWithTabModel:tabModel
334 browserState:browserState 331 browserState:browserState
335 dependencyFactory:factory] autorelease]; 332 dependencyFactory:factory] autorelease];
336 } 333 }
337 334
338 @end 335 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm ('k') | ios/chrome/browser/ui/ntp/new_tab_page_bar.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698