| 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 #include "components/handoff/handoff_manager.h" | 5 #include "components/handoff/handoff_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "net/base/mac/url_conversions.h" | 9 #include "net/base/mac/url_conversions.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #elif defined(OS_IOS) | 53 #elif defined(OS_IOS) |
| 54 _origin = handoff::ORIGIN_IOS; | 54 _origin = handoff::ORIGIN_IOS; |
| 55 #else | 55 #else |
| 56 NOTREACHED(); | 56 NOTREACHED(); |
| 57 #endif | 57 #endif |
| 58 } | 58 } |
| 59 return self; | 59 return self; |
| 60 } | 60 } |
| 61 | 61 |
| 62 - (void)updateActiveURL:(const GURL&)url { | 62 - (void)updateActiveURL:(const GURL&)url { |
| 63 #if defined(OS_IOS) | |
| 64 // Handoff is only available on iOS 8+. | |
| 65 DCHECK(base::ios::IsRunningOnIOS8OrLater()); | |
| 66 #endif | |
| 67 | |
| 68 #if defined(OS_MACOSX) && !defined(OS_IOS) | 63 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 69 // Handoff is only available on OSX 10.10+. | 64 // Handoff is only available on OSX 10.10+. |
| 70 DCHECK(base::mac::IsAtLeastOS10_10()); | 65 DCHECK(base::mac::IsAtLeastOS10_10()); |
| 71 #endif | 66 #endif |
| 72 | 67 |
| 73 _activeURL = url; | 68 _activeURL = url; |
| 74 [self updateUserActivity]; | 69 [self updateUserActivity]; |
| 75 } | 70 } |
| 76 | 71 |
| 77 - (BOOL)shouldUseActiveURL { | 72 - (BOOL)shouldUseActiveURL { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 108 | 103 |
| 109 @end | 104 @end |
| 110 | 105 |
| 111 @implementation HandoffManager (TestingOnly) | 106 @implementation HandoffManager (TestingOnly) |
| 112 | 107 |
| 113 - (NSURL*)userActivityWebpageURL { | 108 - (NSURL*)userActivityWebpageURL { |
| 114 return self.userActivity.webpageURL; | 109 return self.userActivity.webpageURL; |
| 115 } | 110 } |
| 116 | 111 |
| 117 @end | 112 @end |
| OLD | NEW |