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

Unified Diff: content/browser/browser_context.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, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 0117fa6853d50b59db87d42076c29b8b742e6f6f..969ee35af3871318f9d69182bcda3f21776400c4 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -114,8 +114,17 @@ class OffTheRecordClipboardDestroyer : public base::SupportsUserData::Data {
void ExamineClipboard(ui::Clipboard* clipboard,
ui::Clipboard::Buffer buffer) {
ui::Clipboard::SourceTag source_tag = clipboard->ReadSourceTag(buffer);
- if (source_tag == ui::Clipboard::SourceTag(this))
- clipboard->Clear(buffer);
+ if (source_tag == ui::Clipboard::SourceTag(this)) {
+ if (buffer == ui::Clipboard::BUFFER_STANDARD) {
+ // We want to leave invalid SourceTag in the clipboard in order to
+ // collect statistics later.
+ clipboard->WriteObjects(buffer,
+ ui::Clipboard::ObjectMap(),
+ ui::Clipboard::kInvalidSourceTag);
+ } else {
+ clipboard->Clear(buffer);
+ }
+ }
}
};
« no previous file with comments | « no previous file | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698