Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ | |
| 6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ | |
| 7 | |
| 8 #import <Foundation/Foundation.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 // A protocol implemented by delegates to handle logging metrics. | |
| 13 @protocol ClipboardRecentContentMetricsDelegate<NSObject> | |
| 14 | |
| 15 - (void)onClipboardChanged; | |
| 16 | |
| 17 @end | |
| 18 | |
| 19 // Objective C iOS implementation of ClipboardRecentContent. | |
| 20 @interface ClipboardRecentContentIOSImpl : NSObject | |
| 21 | |
| 22 // |delegate| is used for metrics logging and can be nil. |authorizedSchemes| | |
| 23 // should contain all schemes considered valid. |groupUserDefaults| is the | |
| 24 // NSUserDefaults used to store information on pasteboard entry expiration. This | |
| 25 // information will be shared with other applications in the application group. | |
| 26 - (instancetype)initWithDelegate: | |
| 27 (id<ClipboardRecentContentMetricsDelegate>)delegate | |
| 28 authorizedSchemes:(NSArray*)authorizedSchemes | |
| 29 userDefaults:(NSUserDefaults*)groupUserDefaults | |
| 30 NS_DESIGNATED_INITIALIZER; | |
| 31 | |
| 32 - (instancetype)init NS_UNAVAILABLE; | |
| 33 | |
| 34 // ClipboardRecentContent implementation. | |
| 35 - (NSURL*)getRecentURLFromClipboard; | |
| 36 - (NSTimeInterval)getClipboardContentAge; | |
| 37 - (void)suppressClipboardContent; | |
| 38 | |
| 39 // Methods below are exposed for testing purposes. | |
|
jif
2017/03/29 14:17:56
I don't they they are used by tests.
lody
2017/03/30 13:36:34
Line 83 in clipboard_recent_content_ios_unittest:
jif
2017/03/31 13:14:47
What I'm trying to say is that those 2 obj-c metho
lody
2017/03/31 13:28:19
As clarified offline, they are in fact only needed
| |
| 40 | |
| 41 // Estimation of the date when the pasteboard changed. | |
| 42 @property(nonatomic, strong) NSDate* lastPasteboardChangeDate; | |
| 43 | |
| 44 // Saves information to the user defaults about the latest pasteboard entry. | |
| 45 - (void)saveToUserDefaults; | |
| 46 // Returns the uptime. Override in tests to return custom value. | |
|
jif
2017/03/29 14:17:55
Not overridden by tests. And are unittests passing
lody
2017/03/30 13:36:34
You were right. Changed so uptime is actually over
jif
2017/03/31 13:14:47
Acknowledged.
| |
| 47 - (NSTimeInterval)uptime; | |
| 48 | |
| 49 @end | |
| 50 | |
| 51 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ | |
| OLD | NEW |