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

Unified Diff: ios/chrome/browser/device_sharing/device_sharing_manager.h

Issue 2484703003: [ios] Adds code to support the iOS Handoff feature. (Closed)
Patch Set: Fixes. Created 4 years, 1 month 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
Index: ios/chrome/browser/device_sharing/device_sharing_manager.h
diff --git a/ios/chrome/browser/device_sharing/device_sharing_manager.h b/ios/chrome/browser/device_sharing/device_sharing_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3587fb963c00e5701d4f4ccf004c2a2589af0b3
--- /dev/null
+++ b/ios/chrome/browser/device_sharing/device_sharing_manager.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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_DEVICE_SHARING_DEVICE_SHARING_MANAGER_H_
+#define IOS_CHROME_BROWSER_DEVICE_SHARING_DEVICE_SHARING_MANAGER_H_
+
+#import <Foundation/Foundation.h>
+
+class GURL;
+@class HandoffManager;
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+// This manager maintains all state related to sharing the active URL to other
+// devices. It has the role of a dispatcher that shares the active URL to
+// various internal sharing services (e.g. handoff).
+@interface DeviceSharingManager : NSObject
+
+// Updates the internal browser state to |browserState|.
+// If the browser state is already |browserState|, then this is a no-op.
+// Otherwise, this method cleans up the active URL and updates the internal
+// state to reflect the new browser state.
+//
+// Note that this method keep a weak reference to |browserState|. It
+// expects its owner to clear the browser state via a call to
+// |-updateBrowserState:NULL| before |browserState| is destroyed.
erikchen 2016/11/07 22:02:08 s/NULL/nullptr
rohitrao (ping after 24h) 2016/11/08 02:19:42 Done.
+//
+// |browserState| must not be off the record.
+- (void)updateBrowserState:(ios::ChromeBrowserState*)browserState;
+
+// Updates the active URL to be shared with other devices. This method is
+// a no-op if the active browser state was never set previously.
+- (void)updateActiveURL:(const GURL&)activeURL;
+
+@end
+
+@interface DeviceSharingManager (TestingOnly)
+
+// Exposing Handoff feature for testing.
+@property(nonatomic, readonly) HandoffManager* handoffManager;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_DEVICE_SHARING_DEVICE_SHARING_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698