Index: components/open_from_clipboard/clipboard_recent_content_ios_impl.h |
diff --git a/components/open_from_clipboard/clipboard_recent_content_ios_impl.h b/components/open_from_clipboard/clipboard_recent_content_ios_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31289580aa0a151fe2a4b7612d2979e713cc6a36 |
--- /dev/null |
+++ b/components/open_from_clipboard/clipboard_recent_content_ios_impl.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
sdefresne
2017/04/03 09:27:17
File need to be named ${something}_ios.{h,mm} to b
lody
2017/04/04 13:42:18
Acknowledged.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ |
+#define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+#include "base/macros.h" |
sdefresne
2017/04/03 09:27:16
Why this include? You do not use any of the macros
lody
2017/04/04 13:42:18
Done.
|
+ |
+// A protocol implemented by delegates to handle logging metrics. |
+@protocol ClipboardRecentContentMetricsDelegate<NSObject> |
sdefresne
2017/04/03 09:27:17
Maybe just ClipboardRecentContentDelegate (or ${Cl
lody
2017/04/04 13:42:18
Done.
|
+ |
+- (void)onClipboardChanged; |
+ |
+@end |
+ |
+// Objective C iOS implementation of ClipboardRecentContent. |
sdefresne
2017/04/03 09:27:16
Describe what this class does without referencing
lody
2017/04/04 13:42:18
Done.
|
+@interface ClipboardRecentContentIOSImpl : NSObject |
+ |
+// |delegate| is used for metrics logging and can be nil. |authorizedSchemes| |
+// should contain all schemes considered valid. |groupUserDefaults| is the |
+// NSUserDefaults used to store information on pasteboard entry expiration. This |
+// information will be shared with other applications in the application group. |
+- (instancetype)initWithDelegate: |
sdefresne
2017/04/03 09:27:16
delegate seems the least important parameter for t
lody
2017/04/04 13:42:18
Done.
|
+ (id<ClipboardRecentContentMetricsDelegate>)delegate |
+ authorizedSchemes:(NSArray*)authorizedSchemes |
+ userDefaults:(NSUserDefaults*)groupUserDefaults |
+ NS_DESIGNATED_INITIALIZER; |
+ |
+- (instancetype)init NS_UNAVAILABLE; |
+ |
+// ClipboardRecentContent implementation. |
sdefresne
2017/04/03 09:27:16
Describe the methods without referencing Clipboard
lody
2017/04/04 13:42:18
Done.
|
+- (NSURL*)getRecentURLFromClipboard; |
+- (NSTimeInterval)getClipboardContentAge; |
+- (void)suppressClipboardContent; |
+ |
+// Methods below are exposed for testing purposes. |
+ |
+// Estimation of the date when the pasteboard changed. |
+@property(nonatomic, strong) NSDate* lastPasteboardChangeDate; |
+ |
+// Saves information to the user defaults about the latest pasteboard entry. |
+- (void)saveToUserDefaults; |
+ |
+@end |
+ |
+#endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_IMPL_H_ |