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

Unified Diff: components/handoff/handoff_manager.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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/handoff/handoff_manager.h ('k') | components/handoff/handoff_utility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/handoff/handoff_manager.mm
diff --git a/components/handoff/handoff_manager.mm b/components/handoff/handoff_manager.mm
index ab1efd693a5f701accbef39d1f56266cfb14f8eb..0f889d161f8df5eeab8f23e934fd3953c99468c1 100644
--- a/components/handoff/handoff_manager.mm
+++ b/components/handoff/handoff_manager.mm
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/mac/scoped_nsobject.h"
-#include "components/handoff/handoff_utility.h"
#include "net/base/mac/url_conversions.h"
#if defined(OS_IOS)
@@ -39,6 +38,13 @@
self = [super init];
if (self) {
_propertyReleaser_HandoffManager.Init(self, [HandoffManager class]);
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ _origin = handoff::ORIGIN_MAC;
+#elif defined(OS_IOS)
+ _origin = handoff::ORIGIN_IOS;
Avi (use Gerrit) 2015/03/26 18:40:21 #if defined(OS_IOS) _origin = handoff::ORIGIN_
erikchen 2015/03/27 14:52:24 I'm generally a fan of shorter code, but in this c
Avi (use Gerrit) 2015/03/27 15:16:38 That makes sense.
+#else
+ NOTREACHED();
+#endif
}
return self;
}
@@ -84,7 +90,9 @@
withObject:handoff::kChromeHandoffActivityType];
self.userActivity = base::scoped_nsobject<NSUserActivity>(userActivity);
self.userActivity.webpageURL = net::NSURLWithGURL(_activeURL);
- self.userActivity.userInfo = @{ handoff::kOriginKey : handoff::kOriginiOS };
+ NSString* origin = handoff::StringFromOrigin(_origin);
+ DCHECK(origin);
+ self.userActivity.userInfo = @{ handoff::kOriginKey : origin };
[self.userActivity becomeCurrent];
}
« no previous file with comments | « components/handoff/handoff_manager.h ('k') | components/handoff/handoff_utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698