Index: components/open_from_clipboard/clipboard_recent_content_generic.h |
diff --git a/components/open_from_clipboard/clipboard_recent_content_generic.h b/components/open_from_clipboard/clipboard_recent_content_generic.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..60024dc5b9c55639d7337e415d83ccb51a486b54 |
--- /dev/null |
+++ b/components/open_from_clipboard/clipboard_recent_content_generic.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// 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_GENERIC_H_ |
+#define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
+ |
+#include "base/macros.h" |
+#include "base/time/time.h" |
+#include "components/open_from_clipboard/clipboard_recent_content.h" |
+#include "url/gurl.h" |
+ |
+// An implementation of ClipboardRecentContent that uses |
+// ui/base/clipboard/clipboard.h |
+// and hence works on all platforms for which Clipboard is implemented. |
+// (This includes all platforms Chrome runs on except iOS.) |
+// Note that on some platforms Clipboard may not implement the necessary |
+// functions for this provider to function. In those cases, it will not do |
+// anything. |
+class ClipboardRecentContentGeneric : public ClipboardRecentContent { |
+ public: |
+ explicit ClipboardRecentContentGeneric(); |
+ |
+ // ClipboardRecentContent implementation. |
+ bool GetRecentURLFromClipboard(GURL* url) override; |
+ base::TimeDelta GetClipboardContentAge() const override; |
+ void SuppressClipboardContent() override; |
+ |
+ private: |
+ // When told to suppress clipboard content, store the time of the last |
+ // modified clipboard and suppress suggestions that correspond to that time. |
+ // Set to base::Time() if not suppressing clipboard content. |
+ base::Time last_modified_time_to_suppress_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric); |
+}; |
+ |
+#endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |