| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void SetGtkClipboard(Buffer buffer); | 349 void SetGtkClipboard(Buffer buffer); |
| 350 // Insert a mapping into clipboard_data_. | 350 // Insert a mapping into clipboard_data_. |
| 351 void InsertMapping(const char* key, char* data, size_t data_len); | 351 void InsertMapping(const char* key, char* data, size_t data_len); |
| 352 | 352 |
| 353 // Find the gtk clipboard for the passed buffer enum. | 353 // Find the gtk clipboard for the passed buffer enum. |
| 354 GtkClipboard* LookupBackingClipboard(Buffer clipboard) const; | 354 GtkClipboard* LookupBackingClipboard(Buffer clipboard) const; |
| 355 | 355 |
| 356 TargetMap* clipboard_data_; | 356 TargetMap* clipboard_data_; |
| 357 GtkClipboard* clipboard_; | 357 GtkClipboard* clipboard_; |
| 358 GtkClipboard* primary_selection_; | 358 GtkClipboard* primary_selection_; |
| 359 #elif defined(OS_ANDROID) | |
| 360 // Returns whether some text is available from the Android Clipboard. | |
| 361 bool IsTextAvailableFromAndroid() const; | |
| 362 | |
| 363 // Make sure that the Android Clipboard contents matches what we think it | |
| 364 // should contain. If it changed, a copy occured from another application and | |
| 365 // all internal data is dropped. | |
| 366 void ValidateInternalClipboard() const; | |
| 367 | |
| 368 // Clear the Clipboard for all types. Both for Android and internal. | |
| 369 void Clear(); | |
| 370 | |
| 371 // Clear the internal clipboard. | |
| 372 void ClearInternalClipboard() const; | |
| 373 | |
| 374 // This private method is used to set non text key/value. | |
| 375 void Set(const std::string& key, const std::string& value); | |
| 376 | |
| 377 // Java class and methods for the Android ClipboardManager. | |
| 378 base::android::ScopedJavaGlobalRef<jobject> clipboard_manager_; | |
| 379 jmethodID set_text_; | |
| 380 jmethodID has_text_; | |
| 381 jmethodID get_text_; | |
| 382 jmethodID to_string_; | |
| 383 #endif | 359 #endif |
| 384 | 360 |
| 385 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 361 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
| 386 }; | 362 }; |
| 387 | 363 |
| 388 } // namespace ui | 364 } // namespace ui |
| 389 | 365 |
| 390 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 366 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| OLD | NEW |