Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / mac / handoff_utility.h
1 // Copyright 2014 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.
4
5 #ifndef CHROME_BROWSER_MAC_HANDOFF_UTILITY_H_
6 #define CHROME_BROWSER_MAC_HANDOFF_UTILITY_H_
7
8 #import <Foundation/Foundation.h>
9
10 namespace handoff {
11
12 // The value of this key in the userInfo dictionary of an NSUserActivity
13 // indicates the origin. The value should not be used for any privacy or
14 // security sensitive operations, since any application can set the key/value
15 // pair.
16 extern NSString* const kOriginKey;
17
18 // This value indicates that an NSUserActivity originated from Chrome on iOS.
19 extern NSString* const kOriginiOS;
20
21 // This value indicates that an NSUserActivity originated from Chrome on Mac.
22 extern NSString* const kOriginMac;
23
24 // Used for UMA metrics.
25 enum Origin {
26   ORIGIN_UNKNOWN = 0,
27   ORIGIN_IOS = 1,
28   ORIGIN_MAC = 2,
29   ORIGIN_COUNT
30 };
31
32 // Returns ORIGIN_UNKNOWN if |string| is nil or unrecognized.
33 Origin OriginFromString(NSString* string);
34
35 }  // namespace handoff
36
37 #endif  // CHROME_BROWSER_MAC_HANDOFF_UTILITY_H_