| OLD | NEW | 
|   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 #ifndef COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |   5 #ifndef COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ | 
|   6 #define COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |   6 #define COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ | 
|   7  |   7  | 
|   8 #include <Foundation/Foundation.h> |   8 #include <Foundation/Foundation.h> | 
|   9  |   9  | 
|  10 #include "base/mac/objc_property_releaser.h" |  | 
|  11 #include "build/build_config.h" |  10 #include "build/build_config.h" | 
|  12 #include "components/handoff/handoff_utility.h" |  11 #include "components/handoff/handoff_utility.h" | 
|  13 #include "url/gurl.h" |  12 #include "url/gurl.h" | 
|  14  |  13  | 
|  15 @class NSUserActivity; |  14 @class NSUserActivity; | 
|  16  |  15  | 
|  17 #if defined(OS_IOS) |  16 #if defined(OS_IOS) | 
|  18 namespace user_prefs { |  17 namespace user_prefs { | 
|  19 class PrefRegistrySyncable; |  18 class PrefRegistrySyncable; | 
|  20 }  // namespace user_prefs |  19 }  // namespace user_prefs | 
|  21 #endif |  20 #endif | 
|  22  |  21  | 
|  23 // Maintains all of the state relevant to the Handoff feature. Allows Chrome to |  22 // Maintains all of the state relevant to the Handoff feature. Allows Chrome to | 
|  24 // hand off the current active URL to other devices. |  23 // hand off the current active URL to other devices. | 
|  25 @interface HandoffManager : NSObject { |  24 @interface HandoffManager : NSObject | 
|  26  @private |  | 
|  27   base::mac::ObjCPropertyReleaser _propertyReleaser_HandoffManager; |  | 
|  28  |  | 
|  29   GURL _activeURL; |  | 
|  30   NSUserActivity* _userActivity; |  | 
|  31   handoff::Origin _origin; |  | 
|  32 } |  | 
|  33  |  25  | 
|  34 #if defined(OS_IOS) |  26 #if defined(OS_IOS) | 
|  35 // Registers preferences related to Handoff. |  27 // Registers preferences related to Handoff. | 
|  36 + (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry; |  28 + (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry; | 
|  37 #endif |  29 #endif | 
|  38  |  30  | 
|  39 // The active URL is defined as the URL of the most recently accessed tab. This |  31 // The active URL is defined as the URL of the most recently accessed tab. This | 
|  40 // method should be called any time the active URL might have changed. This |  32 // method should be called any time the active URL might have changed. This | 
|  41 // method is idempotent. |  33 // method is idempotent. | 
|  42 - (void)updateActiveURL:(const GURL&)url; |  34 - (void)updateActiveURL:(const GURL&)url; | 
|  43  |  35  | 
|  44 @end |  36 @end | 
|  45  |  37  | 
|  46 @interface HandoffManager (TestingOnly) |  38 @interface HandoffManager (TestingOnly) | 
|  47 - (NSURL*)userActivityWebpageURL; |  39 - (NSURL*)userActivityWebpageURL; | 
|  48 @end |  40 @end | 
|  49  |  41  | 
|  50 #endif  // COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ |  42 #endif  // COMPONENTS_HANDOFF_HANDOFF_MANAGER_H_ | 
| OLD | NEW |