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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 Clipboard::Clipboard() { | 418 Clipboard::Clipboard() { |
419 // Make sure clipboard is created. | 419 // Make sure clipboard is created. |
420 GetClipboard(); | 420 GetClipboard(); |
421 } | 421 } |
422 | 422 |
423 Clipboard::~Clipboard() { | 423 Clipboard::~Clipboard() { |
424 DeleteClipboard(); | 424 DeleteClipboard(); |
425 } | 425 } |
426 | 426 |
427 void Clipboard::WriteObjects(const ObjectMap& objects) { | 427 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { |
| 428 DCHECK(IsValidBuffer(buffer)); |
428 for (ObjectMap::const_iterator iter = objects.begin(); | 429 for (ObjectMap::const_iterator iter = objects.begin(); |
429 iter != objects.end(); ++iter) { | 430 iter != objects.end(); ++iter) { |
430 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 431 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
431 } | 432 } |
432 ClipboardDataBuilder::CommitToClipboard(); | 433 ClipboardDataBuilder::CommitToClipboard(); |
433 } | 434 } |
434 | 435 |
435 bool Clipboard::IsFormatAvailable(const FormatType& format, | 436 bool Clipboard::IsFormatAvailable(const FormatType& format, |
436 Buffer buffer) const { | 437 Buffer buffer) const { |
437 DCHECK(IsValidBuffer(buffer)); | 438 DCHECK(IsValidBuffer(buffer)); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 return type; | 592 return type; |
592 } | 593 } |
593 | 594 |
594 // static | 595 // static |
595 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { | 596 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { |
596 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); | 597 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); |
597 return type; | 598 return type; |
598 } | 599 } |
599 | 600 |
600 } // namespace ui | 601 } // namespace ui |
OLD | NEW |