OLD | NEW |
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_H_ | 5 #ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_ |
6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_ | 6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Returns how old the content of the clipboard is. | 36 // Returns how old the content of the clipboard is. |
37 virtual base::TimeDelta GetClipboardContentAge() const = 0; | 37 virtual base::TimeDelta GetClipboardContentAge() const = 0; |
38 | 38 |
39 // Prevent GetRecentURLFromClipboard from returning anything until the | 39 // Prevent GetRecentURLFromClipboard from returning anything until the |
40 // clipboard's content changed. | 40 // clipboard's content changed. |
41 virtual void SuppressClipboardContent() = 0; | 41 virtual void SuppressClipboardContent() = 0; |
42 | 42 |
43 protected: | 43 protected: |
44 // GetRecentURLFromClipboard() should never return a URL from a clipboard | 44 // GetRecentURLFromClipboard() should never return a URL from a clipboard |
45 // older than this. | 45 // older than this. |
46 const base::TimeDelta kMaximumAgeOfClipboard = base::TimeDelta::FromHours(3); | 46 static base::TimeDelta MaximumAgeOfClipboard(); |
47 | 47 |
48 // Returns true if the URL is appropriate to be suggested. | 48 // Returns true if the URL is appropriate to be suggested. |
49 static bool IsAppropriateSuggestion(const GURL& url); | 49 static bool IsAppropriateSuggestion(const GURL& url); |
50 | 50 |
51 private: | 51 private: |
52 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContent); | 52 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContent); |
53 }; | 53 }; |
54 | 54 |
55 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_ | 55 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_ |
OLD | NEW |