OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "ui/gfx/linux_util.h" | 10 #include "ui/gfx/linux_util.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void Clipboard::WriteObjects(const ObjectMap& objects) { | 144 void Clipboard::WriteObjects(const ObjectMap& objects) { |
145 // We need to overwrite previous data. Probably best to just delete | 145 // We need to overwrite previous data. Probably best to just delete |
146 // everything and start fresh. | 146 // everything and start fresh. |
147 DeleteClipboardData(); | 147 DeleteClipboardData(); |
148 for (ObjectMap::const_iterator iter = objects.begin(); | 148 for (ObjectMap::const_iterator iter = objects.begin(); |
149 iter != objects.end(); ++iter) { | 149 iter != objects.end(); ++iter) { |
150 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 150 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 void Clipboard::WriteObjects(const ObjectMap& objects, | |
155 base::ProcessHandle process) { | |
156 NOTIMPLEMENTED(); | |
157 } | |
158 | |
159 bool Clipboard::IsFormatAvailable(const FormatType& format, | 154 bool Clipboard::IsFormatAvailable(const FormatType& format, |
160 Buffer buffer) const { | 155 Buffer buffer) const { |
161 ClipboardData* data = GetClipboardData(); | 156 ClipboardData* data = GetClipboardData(); |
162 if (GetPlainTextFormatType() == format) | 157 if (GetPlainTextFormatType() == format) |
163 return !data->text().empty(); | 158 return !data->text().empty(); |
164 else if (GetHtmlFormatType() == format) | 159 else if (GetHtmlFormatType() == format) |
165 return !data->markup_data().empty() || !data->url().empty(); | 160 return !data->markup_data().empty() || !data->url().empty(); |
166 else if (GetBitmapFormatType() == format) | 161 else if (GetBitmapFormatType() == format) |
167 return !!data->bitmap_data(); | 162 return !!data->bitmap_data(); |
168 else if (GetWebKitSmartPasteFormatType() == format) | 163 else if (GetWebKitSmartPasteFormatType() == format) |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 Clipboard::FormatType Clipboard::GetBitmapFormatType() { | 318 Clipboard::FormatType Clipboard::GetBitmapFormatType() { |
324 return std::string(kMimeTypeBitmap); | 319 return std::string(kMimeTypeBitmap); |
325 } | 320 } |
326 | 321 |
327 // static | 322 // static |
328 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { | 323 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { |
329 return std::string(kMimeTypeWebkitSmartPaste); | 324 return std::string(kMimeTypeWebkitSmartPaste); |
330 } | 325 } |
331 | 326 |
332 } // namespace ui | 327 } // namespace ui |
OLD | NEW |