Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / components / handoff / handoff_utility.h
blob92ccc5d035a321c1c5da9c40829609b2d9905255
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.
5 #ifndef COMPONENTS_HANDOFF_HANDOFF_UTILITY_H_
6 #define COMPONENTS_HANDOFF_HANDOFF_UTILITY_H_
8 #import <Foundation/Foundation.h>
10 namespace handoff {
12 // The activity type that Chrome uses to pass a Handoff to itself.
13 extern NSString* const kChromeHandoffActivityType;
15 // The value of this key in the userInfo dictionary of an NSUserActivity
16 // indicates the origin. The value should not be used for any privacy or
17 // security sensitive operations, since any application can set the key/value
18 // pair.
19 extern NSString* const kOriginKey;
21 // This value indicates that an NSUserActivity originated from Chrome on iOS.
22 extern NSString* const kOriginiOS;
24 // This value indicates that an NSUserActivity originated from Chrome on Mac.
25 extern NSString* const kOriginMac;
27 // Used for UMA metrics.
28 enum Origin {
29 ORIGIN_UNKNOWN = 0,
30 ORIGIN_IOS = 1,
31 ORIGIN_MAC = 2,
32 ORIGIN_COUNT
35 // Returns ORIGIN_UNKNOWN if |string| is nil or unrecognized.
36 Origin OriginFromString(NSString* string);
38 // Returns nil if |origin| is not ORIGIN_IOS or ORIGIN_MAC.
39 NSString* StringFromOrigin(Origin origin);
41 } // namespace handoff
43 #endif // COMPONENTS_HANDOFF_HANDOFF_UTILITY_H_