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

Side by Side Diff: ui/base/clipboard/clipboard_android.cc

Issue 1034423003: Support clipboardData.getData() for Android Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 std::vector<base::string16>* types, 308 std::vector<base::string16>* types,
309 bool* contains_filenames) const { 309 bool* contains_filenames) const {
310 DCHECK(CalledOnValidThread()); 310 DCHECK(CalledOnValidThread());
311 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); 311 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
312 312
313 if (!types || !contains_filenames) { 313 if (!types || !contains_filenames) {
314 NOTREACHED(); 314 NOTREACHED();
315 return; 315 return;
316 } 316 }
317 317
318 NOTIMPLEMENTED(); 318 types->clear();
319 319
320 types->clear(); 320 if (IsFormatAvailable(GetPlainTextFormatType(), type))
321 types->push_back(base::UTF8ToUTF16(kMimeTypeText));
322 if (IsFormatAvailable(GetHtmlFormatType(), type))
323 types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
324
321 *contains_filenames = false; 325 *contains_filenames = false;
322 } 326 }
323 327
324 void ClipboardAndroid::ReadText(ClipboardType type, 328 void ClipboardAndroid::ReadText(ClipboardType type,
325 base::string16* result) const { 329 base::string16* result) const {
326 DCHECK(CalledOnValidThread()); 330 DCHECK(CalledOnValidThread());
327 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); 331 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
328 std::string utf8; 332 std::string utf8;
329 ReadAsciiText(type, &utf8); 333 ReadAsciiText(type, &utf8);
330 *result = base::UTF8ToUTF16(utf8); 334 *result = base::UTF8ToUTF16(utf8);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 const char* data_data, 462 const char* data_data,
459 size_t data_len) { 463 size_t data_len) {
460 g_map.Get().Set(format.ToString(), std::string(data_data, data_len)); 464 g_map.Get().Set(format.ToString(), std::string(data_data, data_len));
461 } 465 }
462 466
463 bool RegisterClipboardAndroid(JNIEnv* env) { 467 bool RegisterClipboardAndroid(JNIEnv* env) {
464 return RegisterNativesImpl(env); 468 return RegisterNativesImpl(env);
465 } 469 }
466 470
467 } // namespace ui 471 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698