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 <list> | 7 #include <list> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 Clipboard::Clipboard() { | 449 Clipboard::Clipboard() { |
450 // Make sure clipboard is created. | 450 // Make sure clipboard is created. |
451 GetClipboard(); | 451 GetClipboard(); |
452 } | 452 } |
453 | 453 |
454 Clipboard::~Clipboard() { | 454 Clipboard::~Clipboard() { |
455 DeleteClipboard(); | 455 DeleteClipboard(); |
456 } | 456 } |
457 | 457 |
458 void Clipboard::WriteObjects(const ObjectMap& objects) { | 458 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { |
| 459 DCHECK(IsValidBuffer(buffer)); |
459 for (ObjectMap::const_iterator iter = objects.begin(); | 460 for (ObjectMap::const_iterator iter = objects.begin(); |
460 iter != objects.end(); ++iter) { | 461 iter != objects.end(); ++iter) { |
461 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 462 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
462 } | 463 } |
463 ClipboardDataBuilder::CommitToClipboard(); | 464 ClipboardDataBuilder::CommitToClipboard(); |
464 } | 465 } |
465 | 466 |
466 bool Clipboard::IsFormatAvailable(const FormatType& format, | 467 bool Clipboard::IsFormatAvailable(const FormatType& format, |
467 Buffer buffer) const { | 468 Buffer buffer) const { |
468 DCHECK(IsValidBuffer(buffer)); | 469 DCHECK(IsValidBuffer(buffer)); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 return type; | 637 return type; |
637 } | 638 } |
638 | 639 |
639 // static | 640 // static |
640 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { | 641 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { |
641 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); | 642 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); |
642 return type; | 643 return type; |
643 } | 644 } |
644 | 645 |
645 } // namespace ui | 646 } // namespace ui |
OLD | NEW |