erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 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 COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |
| 6 | #define COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |
| 7 | |
olivierrobin | 69709ac6 | 2017-01-06 10:11:56 | [diff] [blame] | 8 | #import <Foundation/Foundation.h> |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 9 | |
rohitrao | f5225f68 | 2016-11-08 23:44:27 | [diff] [blame] | 10 | #include "build/build_config.h" |
erikchen | 56915573 | 2015-03-27 15:29:38 | [diff] [blame] | 11 | #include "components/handoff/handoff_utility.h" |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 12 | #include "url/gurl.h" |
| 13 | |
| 14 | @class NSUserActivity; |
| 15 | |
rohitrao | f5225f68 | 2016-11-08 23:44:27 | [diff] [blame] | 16 | #if defined(OS_IOS) |
| 17 | namespace user_prefs { |
| 18 | class PrefRegistrySyncable; |
| 19 | } // namespace user_prefs |
| 20 | #endif |
| 21 | |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 22 | // Maintains all of the state relevant to the Handoff feature. Allows Chrome to |
| 23 | // hand off the current active URL to other devices. |
stkhapugin | 6e97ef0a | 2016-11-29 16:14:02 | [diff] [blame] | 24 | @interface HandoffManager : NSObject |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 25 | |
rohitrao | f5225f68 | 2016-11-08 23:44:27 | [diff] [blame] | 26 | #if defined(OS_IOS) |
| 27 | // Registers preferences related to Handoff. |
| 28 | + (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry; |
| 29 | #endif |
| 30 | |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 31 | // The active URL is defined as the URL of the most recently accessed tab. This |
| 32 | // method should be called any time the active URL might have changed. This |
| 33 | // method is idempotent. |
Nico Weber | 23f11eae | 2017-07-13 23:39:41 | [diff] [blame] | 34 | - (void)updateActiveURL:(const GURL&)url API_AVAILABLE(macos(10.10)); |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 35 | |
| 36 | @end |
| 37 | |
Peter Collingbourne | fc74af3 | 2017-07-10 21:00:18 | [diff] [blame] | 38 | #if defined(OS_IOS) |
rohitrao | f5225f68 | 2016-11-08 23:44:27 | [diff] [blame] | 39 | @interface HandoffManager (TestingOnly) |
| 40 | - (NSURL*)userActivityWebpageURL; |
| 41 | @end |
Peter Collingbourne | fc74af3 | 2017-07-10 21:00:18 | [diff] [blame] | 42 | #endif |
rohitrao | f5225f68 | 2016-11-08 23:44:27 | [diff] [blame] | 43 | |
erikchen | 600f796 | 2014-12-12 00:17:38 | [diff] [blame] | 44 | #endif // COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |