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

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

Issue 2881183002: Revert of Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: 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_release_properties.h" 7 #include "base/mac/objc_property_releaser.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;
30 } 32 }
31 33
32 // Responsible for maintaining all state related to sharing to other devices. 34 // Responsible for maintaining all state related to sharing to other devices.
33 // Redeclared readwrite from the readonly declaration in the Testing interface. 35 // Redeclared readwrite from the readonly declaration in the Testing interface.
34 @property(nonatomic, retain, readwrite) 36 @property(nonatomic, retain, readwrite)
35 DeviceSharingManager* deviceSharingManager; 37 DeviceSharingManager* deviceSharingManager;
36 38
37 // Creates a new autoreleased tab model for |browserState|; if |empty| is NO, 39 // Creates a new autoreleased tab model for |browserState|; if |empty| is NO,
38 // then any existing tabs that have been saved for |browserState| will be 40 // then any existing tabs that have been saved for |browserState| will be
39 // loaded; otherwise, the tab model will be created empty. 41 // loaded; otherwise, the tab model will be created empty.
(...skipping 19 matching lines...) Expand all
59 @synthesize mainTabModel = _mainTabModel; 61 @synthesize mainTabModel = _mainTabModel;
60 @synthesize otrBVC = _otrBVC; 62 @synthesize otrBVC = _otrBVC;
61 @synthesize otrTabModel = _otrTabModel; 63 @synthesize otrTabModel = _otrTabModel;
62 @synthesize currentBVC = _currentBVC; 64 @synthesize currentBVC = _currentBVC;
63 // Private properies. 65 // Private properies.
64 @synthesize deviceSharingManager = _deviceSharingManager; 66 @synthesize deviceSharingManager = _deviceSharingManager;
65 67
66 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState 68 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
67 tabModelObserver:(id<TabModelObserver>)tabModelObserver { 69 tabModelObserver:(id<TabModelObserver>)tabModelObserver {
68 if ((self = [super init])) { 70 if ((self = [super init])) {
71 _propertyReleaser_BrowserViewWrangler.Init(self,
72 [BrowserViewWrangler class]);
69 _browserState = browserState; 73 _browserState = browserState;
70 _tabModelObserver = tabModelObserver; 74 _tabModelObserver = tabModelObserver;
71 } 75 }
72 return self; 76 return self;
73 } 77 }
74 78
75 - (instancetype)init { 79 - (instancetype)init {
76 NOTREACHED(); 80 NOTREACHED();
77 return nil; 81 return nil;
78 } 82 }
(...skipping 11 matching lines...) Expand all
90 94
91 // Stop Breakpad state monitoring of both tab models (if necessary). 95 // Stop Breakpad state monitoring of both tab models (if necessary).
92 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel); 96 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel);
93 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel); 97 ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel);
94 98
95 // Normally other objects will take care of unhooking the tab models from 99 // Normally other objects will take care of unhooking the tab models from
96 // the browser state, but this code should ensure that it happens regardless. 100 // the browser state, but this code should ensure that it happens regardless.
97 [_mainTabModel browserStateDestroyed]; 101 [_mainTabModel browserStateDestroyed];
98 [_otrTabModel browserStateDestroyed]; 102 [_otrTabModel browserStateDestroyed];
99 103
100 base::mac::ReleaseProperties(self);
101 [super dealloc]; 104 [super dealloc];
102 } 105 }
103 106
104 #pragma mark - BrowserViewInformation property implementations 107 #pragma mark - BrowserViewInformation property implementations
105 108
106 - (BrowserViewController*)mainBVC { 109 - (BrowserViewController*)mainBVC {
107 if (!_mainBVC) { 110 if (!_mainBVC) {
108 // |_browserState| should always be set before trying to create 111 // |_browserState| should always be set before trying to create
109 // |_mainBVC|. 112 // |_mainBVC|.
110 DCHECK(_browserState); 113 DCHECK(_browserState);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 tabModel:(TabModel*)tabModel { 329 tabModel:(TabModel*)tabModel {
327 base::scoped_nsobject<BrowserViewControllerDependencyFactory> factory( 330 base::scoped_nsobject<BrowserViewControllerDependencyFactory> factory(
328 [[BrowserViewControllerDependencyFactory alloc] 331 [[BrowserViewControllerDependencyFactory alloc]
329 initWithBrowserState:browserState]); 332 initWithBrowserState:browserState]);
330 return [[[BrowserViewController alloc] initWithTabModel:tabModel 333 return [[[BrowserViewController alloc] initWithTabModel:tabModel
331 browserState:browserState 334 browserState:browserState
332 dependencyFactory:factory] autorelease]; 335 dependencyFactory:factory] autorelease];
333 } 336 }
334 337
335 @end 338 @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