| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/installation_notifier.h" | 5 #import "ios/chrome/browser/installation_notifier.h" |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 [_notificationCenter addObserver:observer | 125 [_notificationCenter addObserver:observer |
| 126 selector:notificationSelector | 126 selector:notificationSelector |
| 127 name:scheme | 127 name:scheme |
| 128 object:self]; | 128 object:self]; |
| 129 _backoffEntry->Reset(); | 129 _backoffEntry->Reset(); |
| 130 if (poll) | 130 if (poll) |
| 131 [self dispatchInstallationNotifierBlock]; | 131 [self dispatchInstallationNotifierBlock]; |
| 132 } | 132 } |
| 133 | 133 |
| 134 - (void)unregisterForNotifications:(id)observer { | 134 - (void)unregisterForNotifications:(id)observer { |
| 135 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 135 // DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 136 NSValue* weakReferenceToObserver = | 136 NSValue* weakReferenceToObserver = |
| 137 [NSValue valueWithNonretainedObject:observer]; | 137 [NSValue valueWithNonretainedObject:observer]; |
| 138 [_notificationCenter removeObserver:observer]; | 138 [_notificationCenter removeObserver:observer]; |
| 139 for (NSString* scheme in [_installedAppObservers allKeys]) { | 139 for (NSString* scheme in [_installedAppObservers allKeys]) { |
| 140 DCHECK([scheme isKindOfClass:[NSString class]]); | 140 DCHECK([scheme isKindOfClass:[NSString class]]); |
| 141 NSMutableSet* observers = [_installedAppObservers objectForKey:scheme]; | 141 NSMutableSet* observers = [_installedAppObservers objectForKey:scheme]; |
| 142 if ([observers containsObject:weakReferenceToObserver]) { | 142 if ([observers containsObject:weakReferenceToObserver]) { |
| 143 [observers removeObject:weakReferenceToObserver]; | 143 [observers removeObject:weakReferenceToObserver]; |
| 144 if ([observers count] == 0) { | 144 if ([observers count] == 0) { |
| 145 [_installedAppObservers removeObjectForKey:scheme]; | 145 [_installedAppObservers removeObjectForKey:scheme]; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 - (void)setSharedApplication:(id)sharedApplication { | 218 - (void)setSharedApplication:(id)sharedApplication { |
| 219 // Verify that the test application object responds to all the selectors that | 219 // Verify that the test application object responds to all the selectors that |
| 220 // will be called on it. | 220 // will be called on it. |
| 221 CHECK([sharedApplication respondsToSelector:@selector(canOpenURL:)]); | 221 CHECK([sharedApplication respondsToSelector:@selector(canOpenURL:)]); |
| 222 sharedApplication_ = (UIApplication*)sharedApplication; | 222 sharedApplication_ = (UIApplication*)sharedApplication; |
| 223 } | 223 } |
| 224 | 224 |
| 225 @end | 225 @end |
| OLD | NEW |