| OLD | NEW |
| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // Reads a bookmark from the clipboard, if available. | 200 // Reads a bookmark from the clipboard, if available. |
| 201 virtual void ReadBookmark(base::string16* title, std::string* url) const = 0; | 201 virtual void ReadBookmark(base::string16* title, std::string* url) const = 0; |
| 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 GetLastModifiedTime() const; |
| 211 |
| 212 // Resets the clipboard last modified time to Time::Time(). |
| 213 virtual void ClearLastModifiedTime(); |
| 211 | 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(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ |
| OLD | NEW |