OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_GENERIC_H_ | 5 #ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ | 6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "components/open_from_clipboard/clipboard_recent_content.h" | 10 #include "components/open_from_clipboard/clipboard_recent_content.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 // An implementation of ClipboardRecentContent that uses | 13 // An implementation of ClipboardRecentContent that uses |
14 // ui/base/clipboard/clipboard.h | 14 // ui/base/clipboard/clipboard.h |
15 // and hence works on all platforms for which Clipboard is implemented. | 15 // and hence works on all platforms for which Clipboard is implemented. |
16 // (This includes all platforms Chrome runs on except iOS.) | 16 // (This includes all platforms Chrome runs on except iOS.) |
17 // Note that on some platforms Clipboard may not implement the necessary | 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 | 18 // functions for this provider to function. In those cases, it will not do |
19 // anything. | 19 // anything. |
20 class ClipboardRecentContentGeneric : public ClipboardRecentContent { | 20 class ClipboardRecentContentGeneric : public ClipboardRecentContent { |
21 public: | 21 public: |
22 explicit ClipboardRecentContentGeneric(); | 22 explicit ClipboardRecentContentGeneric(); |
23 | 23 |
24 // ClipboardRecentContent implementation. | 24 // ClipboardRecentContent implementation. |
25 bool GetRecentURLFromClipboard(GURL* url) override; | 25 bool GetRecentURLFromClipboard(GURL* url) override; |
26 base::TimeDelta GetClipboardContentAge() const override; | 26 base::TimeDelta GetClipboardContentAge() const override; |
27 void SuppressClipboardContent() override; | 27 void SuppressClipboardContent() override; |
28 | 28 |
29 private: | 29 private: |
| 30 // Returns true if the URL is appropriate to be suggested. |
| 31 static bool IsAppropriateSuggestion(const GURL& url); |
| 32 |
30 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric); | 33 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric); |
31 }; | 34 }; |
32 | 35 |
33 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ | 36 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ |
OLD | NEW |