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

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

Issue 2766623003: Make Android Clipboard Keep Track of Last Modified Time (Closed)
Patch Set: final attempt at restoring Created 3 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 | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_android.h » ('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 <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void Clipboard::DestroyClipboardForCurrentThread() { 79 void Clipboard::DestroyClipboardForCurrentThread() {
80 base::AutoLock lock(clipboard_map_lock_.Get()); 80 base::AutoLock lock(clipboard_map_lock_.Get());
81 81
82 ClipboardMap* clipboard_map = clipboard_map_.Pointer(); 82 ClipboardMap* clipboard_map = clipboard_map_.Pointer();
83 base::PlatformThreadId id = base::PlatformThread::CurrentId(); 83 base::PlatformThreadId id = base::PlatformThread::CurrentId();
84 ClipboardMap::iterator it = clipboard_map->find(id); 84 ClipboardMap::iterator it = clipboard_map->find(id);
85 if (it != clipboard_map->end()) 85 if (it != clipboard_map->end())
86 clipboard_map->erase(it); 86 clipboard_map->erase(it);
87 } 87 }
88 88
89 base::Time Clipboard::GetClipboardLastModifiedTime() const {
90 return base::Time();
91 }
92
89 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) { 93 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
90 // Ignore writes with empty parameters. 94 // Ignore writes with empty parameters.
91 for (const auto& param : params) { 95 for (const auto& param : params) {
92 if (param.empty()) 96 if (param.empty())
93 return; 97 return;
94 } 98 }
95 99
96 switch (type) { 100 switch (type) {
97 case CBF_TEXT: 101 case CBF_TEXT:
98 WriteText(&(params[0].front()), params[0].size()); 102 WriteText(&(params[0].front()), params[0].size());
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 std::find(allowed_threads->begin(), allowed_threads->end(), id) == 161 std::find(allowed_threads->begin(), allowed_threads->end(), id) ==
158 allowed_threads->end()) { 162 allowed_threads->end()) {
159 NOTREACHED(); 163 NOTREACHED();
160 base::debug::DumpWithoutCrashing(); 164 base::debug::DumpWithoutCrashing();
161 } 165 }
162 166
163 return id; 167 return id;
164 } 168 }
165 169
166 } // namespace ui 170 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698