Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / ios / chrome / browser / installation_notifier.h
blob55f74d169580ee37391ce2572ab1bbfe5c1d131a
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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_INSTALLATION_NOTIFIER_H_
6 #define IOS_CHROME_BROWSER_INSTALLATION_NOTIFIER_H_
8 #import <Foundation/Foundation.h>
10 class GURL;
12 // Protocol used to mock the delayed dispatching for the unit tests.
13 // Calls |block| after |delayInNSec|.
14 @protocol DispatcherProtocol<NSObject>
15 - (void)dispatchAfter:(int64_t)delayInNSec withBlock:(dispatch_block_t)block;
16 @end
18 @interface InstallationNotifier : NSObject
19 // Returns singleton instance.
20 + (InstallationNotifier*)sharedInstance;
22 // Registers |observer| to be sent a notification named |scheme| when a URL
23 // with |scheme| can be opened. |observer| must not be nil. If |scheme| is nil
24 // or an empty string, |observer| is not registered for anything.
25 - (void)registerForInstallationNotifications:(id)observer
26 withSelector:(SEL)notificationSelector
27 forScheme:(NSString*)scheme;
29 // Unregisters all the NSNotifications ever asked by |observer|.
30 - (void)unregisterForNotifications:(id)observer;
32 // Performs a check for installed apps right away and restarts the polling.
33 // There is usually no need for registered observers to call this method, unless
34 // registered observers need to know the accurate state of installed native
35 // apps.
36 - (void)checkNow;
37 @end
39 #endif // IOS_CHROME_BROWSER_INSTALLATION_NOTIFIER_H_