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 #include "ui/base/clipboard/clipboard_android.h" | 5 #include "ui/base/clipboard/clipboard_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
12 #include "jni/Clipboard_jni.h" | 12 #include "jni/Clipboard_jni.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/geometry/size.h" |
15 | 15 |
16 // TODO:(andrewhayden) Support additional formats in Android: Bitmap, URI, HTML, | 16 // TODO:(andrewhayden) Support additional formats in Android: Bitmap, URI, HTML, |
17 // HTML+text now that Android's clipboard system supports them, then nuke the | 17 // HTML+text now that Android's clipboard system supports them, then nuke the |
18 // legacy implementation note below. | 18 // legacy implementation note below. |
19 | 19 |
20 // Legacy implementation note: | 20 // Legacy implementation note: |
21 // The Android clipboard system used to only support text format. So we used the | 21 // The Android clipboard system used to only support text format. So we used the |
22 // Android system when some text was added or retrieved from the system. For | 22 // Android system when some text was added or retrieved from the system. For |
23 // anything else, we STILL store the value in some process wide static | 23 // anything else, we STILL store the value in some process wide static |
24 // variable protected by a lock. So the (non-text) clipboard will only work | 24 // variable protected by a lock. So the (non-text) clipboard will only work |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 const char* data_data, | 458 const char* data_data, |
459 size_t data_len) { | 459 size_t data_len) { |
460 g_map.Get().Set(format.ToString(), std::string(data_data, data_len)); | 460 g_map.Get().Set(format.ToString(), std::string(data_data, data_len)); |
461 } | 461 } |
462 | 462 |
463 bool RegisterClipboardAndroid(JNIEnv* env) { | 463 bool RegisterClipboardAndroid(JNIEnv* env) { |
464 return RegisterNativesImpl(env); | 464 return RegisterNativesImpl(env); |
465 } | 465 } |
466 | 466 |
467 } // namespace ui | 467 } // namespace ui |
OLD | NEW |