| OLD | NEW |
| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return data_ == other.data_; | 191 return data_ == other.data_; |
| 192 } | 192 } |
| 193 | 193 |
| 194 Clipboard::Clipboard() { | 194 Clipboard::Clipboard() { |
| 195 } | 195 } |
| 196 | 196 |
| 197 Clipboard::~Clipboard() { | 197 Clipboard::~Clipboard() { |
| 198 } | 198 } |
| 199 | 199 |
| 200 // Main entry point used to write several values in the clipboard. | 200 // Main entry point used to write several values in the clipboard. |
| 201 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { | 201 void Clipboard::WriteObjectsImpl(Buffer buffer, const ObjectMap& objects) { |
| 202 DCHECK_EQ(buffer, BUFFER_STANDARD); | 202 DCHECK_EQ(buffer, BUFFER_STANDARD); |
| 203 g_map.Get().Clear(); | 203 g_map.Get().Clear(); |
| 204 for (ObjectMap::const_iterator iter = objects.begin(); | 204 for (ObjectMap::const_iterator iter = objects.begin(); |
| 205 iter != objects.end(); ++iter) { | 205 iter != objects.end(); ++iter) { |
| 206 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 206 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 uint64 Clipboard::GetSequenceNumber(Clipboard::Buffer /* buffer */) { | 210 uint64 Clipboard::GetSequenceNumber(Clipboard::Buffer /* buffer */) { |
| 211 // TODO: implement this. For now this interface will advertise | 211 // TODO: implement this. For now this interface will advertise |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 packed += std::string(pixel_data, bm_size); | 404 packed += std::string(pixel_data, bm_size); |
| 405 g_map.Get().Set(kBitmapFormat, packed); | 405 g_map.Get().Set(kBitmapFormat, packed); |
| 406 } | 406 } |
| 407 | 407 |
| 408 void Clipboard::WriteData(const Clipboard::FormatType& format, | 408 void Clipboard::WriteData(const Clipboard::FormatType& format, |
| 409 const char* data_data, size_t data_len) { | 409 const char* data_data, size_t data_len) { |
| 410 g_map.Get().Set(format.data(), std::string(data_data, data_len)); | 410 g_map.Get().Set(format.data(), std::string(data_data, data_len)); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace ui | 413 } // namespace ui |
| OLD | NEW |