Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: components/handoff/handoff_utility.mm

Issue 1000723003: handoff: Fix the origin so that it correctly reflects the sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #include "components/handoff/handoff_utility.h" 5 #include "components/handoff/handoff_utility.h"
6 6
7 namespace handoff { 7 namespace handoff {
8 8
9 NSString* const kChromeHandoffActivityType = @"com.google.chrome.handoff"; 9 NSString* const kChromeHandoffActivityType = @"com.google.chrome.handoff";
10 NSString* const kOriginKey = @"kOriginKey"; 10 NSString* const kOriginKey = @"kOriginKey";
11 NSString* const kOriginiOS = @"kOriginiOS"; 11 NSString* const kOriginiOS = @"kOriginiOS";
12 NSString* const kOriginMac = @"kOriginMac"; 12 NSString* const kOriginMac = @"kOriginMac";
13 13
14 Origin OriginFromString(NSString* string) { 14 Origin OriginFromString(NSString* string) {
15 if ([string isEqualToString:kOriginiOS]) 15 if ([string isEqualToString:kOriginiOS])
16 return ORIGIN_IOS; 16 return ORIGIN_IOS;
17 17
18 if ([string isEqualToString:kOriginMac]) 18 if ([string isEqualToString:kOriginMac])
19 return ORIGIN_MAC; 19 return ORIGIN_MAC;
20 20
21 return ORIGIN_UNKNOWN; 21 return ORIGIN_UNKNOWN;
22 } 22 }
23 23
24 NSString* StringFromOrigin(Origin origin) {
25 switch (origin) {
26 case ORIGIN_IOS:
27 return kOriginiOS;
28 case ORIGIN_MAC:
29 return kOriginMac;
30 default:
31 return nil;
32 }
33 }
34
24 } // namespace handoff 35 } // namespace handoff
OLDNEW
« components/handoff/handoff_manager.mm ('K') | « components/handoff/handoff_utility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698