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_GENERIC_H_ |
| 6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" |
| 10 #include "components/open_from_clipboard/clipboard_recent_content.h" |
| 11 #include "url/gurl.h" |
| 12 |
| 13 // An implementation of ClipboardRecentContent that uses |
| 14 // ui/base/clipboard/clipboard.h |
| 15 // and hence works on all platforms for which Clipboard is implemented. |
| 16 // (This includes all platforms Chrome runs on except iOS.) |
| 17 // Note that on some platforms Clipboard may not implement the necessary |
| 18 // functions for this provider to function. In those cases, it will not do |
| 19 // anything. |
| 20 class ClipboardRecentContentGeneric : public ClipboardRecentContent { |
| 21 public: |
| 22 explicit ClipboardRecentContentGeneric(); |
| 23 |
| 24 // ClipboardRecentContent implementation. |
| 25 bool GetRecentURLFromClipboard(GURL* url) override; |
| 26 base::TimeDelta GetClipboardContentAge() const override; |
| 27 void SuppressClipboardContent() override; |
| 28 |
| 29 private: |
| 30 // When told to suppress clipboard content, store the time of the last |
| 31 // modified clipboard and suppress suggestions that correspond to that time. |
| 32 // Set to base::Time() if not suppressing clipboard content. |
| 33 base::Time last_modified_time_to_suppress_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric); |
| 36 }; |
| 37 |
| 38 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
OLD | NEW |