| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 Clipboard::Clipboard() { | 450 Clipboard::Clipboard() { |
| 451 // Make sure clipboard is created. | 451 // Make sure clipboard is created. |
| 452 GetClipboard(); | 452 GetClipboard(); |
| 453 } | 453 } |
| 454 | 454 |
| 455 Clipboard::~Clipboard() { | 455 Clipboard::~Clipboard() { |
| 456 DeleteClipboard(); | 456 DeleteClipboard(); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void Clipboard::WriteObjects(const ObjectMap& objects) { | 459 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { |
| 460 DCHECK(IsValidBuffer(buffer)); |
| 460 for (ObjectMap::const_iterator iter = objects.begin(); | 461 for (ObjectMap::const_iterator iter = objects.begin(); |
| 461 iter != objects.end(); ++iter) { | 462 iter != objects.end(); ++iter) { |
| 462 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 463 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
| 463 } | 464 } |
| 464 ClipboardDataBuilder::CommitToClipboard(); | 465 ClipboardDataBuilder::CommitToClipboard(); |
| 465 } | 466 } |
| 466 | 467 |
| 467 bool Clipboard::IsFormatAvailable(const FormatType& format, | 468 bool Clipboard::IsFormatAvailable(const FormatType& format, |
| 468 Buffer buffer) const { | 469 Buffer buffer) const { |
| 469 DCHECK(IsValidBuffer(buffer)); | 470 DCHECK(IsValidBuffer(buffer)); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 return type; | 632 return type; |
| 632 } | 633 } |
| 633 | 634 |
| 634 // static | 635 // static |
| 635 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { | 636 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { |
| 636 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); | 637 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); |
| 637 return type; | 638 return type; |
| 638 } | 639 } |
| 639 | 640 |
| 640 } // namespace ui | 641 } // namespace ui |
| OLD | NEW |