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

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

Issue 12313009: Add UMA statistics to the clipboard (Closed) Base URL: http://git.chromium.org/chromium/src.git@bug-177140-fix-test
Patch Set: Remove unnecessary READ_* values Created 7 years, 9 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 | « ui/base/clipboard/clipboard.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | 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.h" 5 #include "ui/base/clipboard/clipboard.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/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const { 247 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
248 DCHECK_EQ(buffer, BUFFER_STANDARD); 248 DCHECK_EQ(buffer, BUFFER_STANDARD);
249 std::string utf8; 249 std::string utf8;
250 ReadAsciiText(buffer, &utf8); 250 ReadAsciiText(buffer, &utf8);
251 *result = UTF8ToUTF16(utf8); 251 *result = UTF8ToUTF16(utf8);
252 } 252 }
253 253
254 void Clipboard::ReadAsciiText(Clipboard::Buffer buffer, 254 void Clipboard::ReadAsciiText(Clipboard::Buffer buffer,
255 std::string* result) const { 255 std::string* result) const {
256 DCHECK_EQ(buffer, BUFFER_STANDARD); 256 DCHECK_EQ(buffer, BUFFER_STANDARD);
257 ReportAction(buffer, READ_TEXT);
257 *result = g_map.Get().Get(kPlainTextFormat); 258 *result = g_map.Get().Get(kPlainTextFormat);
258 } 259 }
259 260
260 // Note: |src_url| isn't really used. It is only implemented in Windows 261 // Note: |src_url| isn't really used. It is only implemented in Windows
261 void Clipboard::ReadHTML(Clipboard::Buffer buffer, 262 void Clipboard::ReadHTML(Clipboard::Buffer buffer,
262 string16* markup, 263 string16* markup,
263 std::string* src_url, 264 std::string* src_url,
264 uint32* fragment_start, 265 uint32* fragment_start,
265 uint32* fragment_end) const { 266 uint32* fragment_end) const {
266 DCHECK_EQ(buffer, BUFFER_STANDARD); 267 DCHECK_EQ(buffer, BUFFER_STANDARD);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 429 }
429 430
430 void Clipboard::WriteSourceTag(SourceTag tag) { 431 void Clipboard::WriteSourceTag(SourceTag tag) {
431 if (tag != SourceTag()) { 432 if (tag != SourceTag()) {
432 ObjectMapParam binary = SourceTag2Binary(tag); 433 ObjectMapParam binary = SourceTag2Binary(tag);
433 WriteData(GetSourceTagFormatType(), &binary[0], binary.size()); 434 WriteData(GetSourceTagFormatType(), &binary[0], binary.size());
434 } 435 }
435 } 436 }
436 437
437 } // namespace ui 438 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698