summaryrefslogtreecommitdiff
path: root/chromium/components/open_from_clipboard/clipboard_recent_content_generic.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/open_from_clipboard/clipboard_recent_content_generic.h')
-rw-r--r--chromium/components/open_from_clipboard/clipboard_recent_content_generic.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/chromium/components/open_from_clipboard/clipboard_recent_content_generic.h b/chromium/components/open_from_clipboard/clipboard_recent_content_generic.h
new file mode 100644
index 00000000000..c0b8704742a
--- /dev/null
+++ b/chromium/components/open_from_clipboard/clipboard_recent_content_generic.h
@@ -0,0 +1,33 @@
+// 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:
+ DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric);
+};
+
+#endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_