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

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: 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') | ui/base/clipboard/clipboard.h » ('J')
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..78a098b36b8b8bb2a1bbdb48dec3bff21b2fb04f 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -114,8 +114,16 @@ 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)
sky 2013/02/20 18:26:02 use {} around these.
vasilii 2013/02/21 10:36:01 Done.
+ // We want to leave invalid SourceTag in the clipboard in order to
+ // collect statistic later.
sky 2013/02/20 18:26:02 statistic -> statistics
vasilii 2013/02/21 10:36:01 Done.
+ 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') | ui/base/clipboard/clipboard.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698