summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.h
blob: f753924320117faf58c192f6d9d2063d4d192dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_AUTHORIZATION_ALERT_H_
#define IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_AUTHORIZATION_ALERT_H_

#import <Foundation/Foundation.h>

@class OmniboxGeolocationAuthorizationAlert;

// Defines the methods to be implemented by a delegate of an
// OmniboxGeolocationAuthorizationAlert.
@protocol OmniboxGeolocationAuthorizationAlertDelegate

// Notifies the receiver that the user authorized the use of geolocation for
// Omnibox queries.
- (void)authorizationAlertDidAuthorize:
        (OmniboxGeolocationAuthorizationAlert*)authorizationAlert;

// Notifies the receiver that the user canceled the use of geolocation for
// Omnibox queries.
- (void)authorizationAlertDidCancel:
        (OmniboxGeolocationAuthorizationAlert*)authorizationAlert;

@end

// Presents the alert view that prompts the user to authorize using geolocation
// for Omnibox queries.
@interface OmniboxGeolocationAuthorizationAlert : NSObject

// The delegate for this OmniboxGeolocationAuthorizationAlert.
@property(nonatomic, assign)
    id<OmniboxGeolocationAuthorizationAlertDelegate> delegate;

// Designated initializer. Initializes this instance with |delegate|.
- (instancetype)initWithDelegate:
        (id<OmniboxGeolocationAuthorizationAlertDelegate>)delegate
    NS_DESIGNATED_INITIALIZER;

// Shows the authorization alert.
- (void)showAuthorizationAlert;

@end

#endif  // IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_AUTHORIZATION_ALERT_H_