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

Side by Side Diff: ui/base/clipboard/clipboard.h

Issue 2812773002: Refactor Clipboard Last Modified Time Storage (Closed)
Patch Set: load on startup 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_BASE_CLIPBOARD_CLIPBOARD_H_ 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_
6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 // Reads raw data from the clipboard with the given format type. Stores result 203 // Reads raw data from the clipboard with the given format type. Stores result
204 // as a byte vector. 204 // as a byte vector.
205 virtual void ReadData(const FormatType& format, 205 virtual void ReadData(const FormatType& format,
206 std::string* result) const = 0; 206 std::string* result) const = 0;
207 207
208 // Returns an estimate of the time the clipboard was last updated. If the 208 // Returns an estimate of the time the clipboard was last updated. If the
209 // time is unknown, returns Time::Time(). 209 // time is unknown, returns Time::Time().
210 virtual base::Time GetClipboardLastModifiedTime() const; 210 virtual base::Time GetClipboardLastModifiedTime() const;
211 211
212 // Resets the clipboard last modified time to Time::Time().
213 virtual void ClearClipboardLastModifiedTime();
dcheng 2017/04/12 00:56:09 Nit: omit Clipboard (probably should omit from Get
Mark P 2017/04/12 21:33:51 Good idea. Clipboard is obvious. Did both.
214
212 // Gets the FormatType corresponding to an arbitrary format string, 215 // Gets the FormatType corresponding to an arbitrary format string,
213 // registering it with the system if needed. Due to Windows/Linux 216 // registering it with the system if needed. Due to Windows/Linux
214 // limitiations, |format_string| must never be controlled by the user. 217 // limitiations, |format_string| must never be controlled by the user.
215 static FormatType GetFormatType(const std::string& format_string); 218 static FormatType GetFormatType(const std::string& format_string);
216 219
217 // Get format identifiers for various types. 220 // Get format identifiers for various types.
218 static const FormatType& GetUrlFormatType(); 221 static const FormatType& GetUrlFormatType();
219 static const FormatType& GetUrlWFormatType(); 222 static const FormatType& GetUrlWFormatType();
220 static const FormatType& GetMozUrlFormatType(); 223 static const FormatType& GetMozUrlFormatType();
221 static const FormatType& GetPlainTextFormatType(); 224 static const FormatType& GetPlainTextFormatType();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 348
346 // Mutex that controls access to |g_clipboard_map|. 349 // Mutex that controls access to |g_clipboard_map|.
347 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_; 350 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_;
348 351
349 DISALLOW_COPY_AND_ASSIGN(Clipboard); 352 DISALLOW_COPY_AND_ASSIGN(Clipboard);
350 }; 353 };
351 354
352 } // namespace ui 355 } // namespace ui
353 356
354 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ 357 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698