Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: components/open_from_clipboard/clipboard_recent_content_generic.h

Issue 2812773002: Refactor Clipboard Last Modified Time Storage (Closed)
Patch Set: itri-state enum Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/open_from_clipboard/clipboard_recent_content_generic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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); 30 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContentGeneric);
36 }; 31 };
37 32
38 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_ 33 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_GENERIC_H_
OLDNEW
« no previous file with comments | « no previous file | components/open_from_clipboard/clipboard_recent_content_generic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698