Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: components/open_from_clipboard/clipboard_recent_content_ios.h

Issue 954143004: Fix detection of clipboard change after device restart. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/open_from_clipboard/clipboard_recent_content_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_ 5 #ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_
6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_ 6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_
7 7
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "components/open_from_clipboard/clipboard_recent_content.h" 9 #include "components/open_from_clipboard/clipboard_recent_content.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 12 matching lines...) Expand all
23 void PasteboardChanged(); 23 void PasteboardChanged();
24 24
25 // ClipboardRecentContent implementation. 25 // ClipboardRecentContent implementation.
26 bool GetRecentURLFromClipboard(GURL* url) const override; 26 bool GetRecentURLFromClipboard(GURL* url) const override;
27 27
28 private: 28 private:
29 friend struct DefaultSingletonTraits<ClipboardRecentContentIOS>; 29 friend struct DefaultSingletonTraits<ClipboardRecentContentIOS>;
30 30
31 ClipboardRecentContentIOS(); 31 ClipboardRecentContentIOS();
32 ~ClipboardRecentContentIOS() override; 32 ~ClipboardRecentContentIOS() override;
33 // Loads information from the user defaults about the latest clipboard entry. 33 // Loads information from the user defaults about the latest pasteboard entry.
34 void LoadFromUserDefaults(); 34 void LoadFromUserDefaults();
35 // Saves information to the user defaults about the latest clipboard entry. 35 // Saves information to the user defaults about the latest pasteboard entry.
36 void SaveToUserDefaults(); 36 void SaveToUserDefaults();
37 // Returns the URL contained in the clipboard (if any). 37 // Returns the URL contained in the clipboard (if any).
38 GURL URLFromPasteboard(); 38 GURL URLFromPasteboard();
39 // Returns whether the device has restarted since the last time a pasteboard
40 // change was detected.
41 bool DeviceRestartedSincePasteboardChanged();
39 42
40 // The pasteboard's change count. Increases everytime the pasteboard changes. 43 // The pasteboard's change count. Increases everytime the pasteboard changes.
41 NSInteger lastPasteboardChangeCount_; 44 NSInteger lastPasteboardChangeCount_;
42 // Estimation of the date when the pasteboard changed. 45 // Estimation of the date when the pasteboard changed.
43 base::scoped_nsobject<NSDate> lastPasteboardChangeDate_; 46 base::scoped_nsobject<NSDate> lastPasteboardChangeDate_;
44 // Cache of the GURL contained in the pasteboard (if any). 47 // Cache of the GURL contained in the pasteboard (if any).
45 GURL urlFromPasteboardCache_; 48 GURL urlFromPasteboardCache_;
46 // Bridge to receive notification when the pasteboard changes. 49 // Bridge to receive notification when the pasteboard changes.
47 base::scoped_nsobject<PasteboardNotificationListenerBridge> 50 base::scoped_nsobject<PasteboardNotificationListenerBridge>
48 notificationBridge_; 51 notificationBridge_;
49 52
50 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentIOS); 53 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentIOS);
51 }; 54 };
52 55
53 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_ 56 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_IOS_H_
OLDNEW
« no previous file with comments | « no previous file | components/open_from_clipboard/clipboard_recent_content_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698