| 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 <X11/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.h> | 
| 8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> | 
| 9 #include <list> | 9 #include <list> | 
| 10 #include <set> | 10 #include <set> | 
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 755   ui::AddString16ToVector(title, &data); | 755   ui::AddString16ToVector(title, &data); | 
| 756   scoped_refptr<base::RefCountedMemory> mem( | 756   scoped_refptr<base::RefCountedMemory> mem( | 
| 757       base::RefCountedBytes::TakeVector(&data)); | 757       base::RefCountedBytes::TakeVector(&data)); | 
| 758 | 758 | 
| 759   aurax11_details_->InsertMapping(kMimeTypeMozillaURL, mem); | 759   aurax11_details_->InsertMapping(kMimeTypeMozillaURL, mem); | 
| 760 } | 760 } | 
| 761 | 761 | 
| 762 // Write an extra flavor that signifies WebKit was the last to modify the | 762 // Write an extra flavor that signifies WebKit was the last to modify the | 
| 763 // pasteboard. This flavor has no data. | 763 // pasteboard. This flavor has no data. | 
| 764 void Clipboard::WriteWebSmartPaste() { | 764 void Clipboard::WriteWebSmartPaste() { | 
| 765   aurax11_details_->InsertMapping(kMimeTypeWebkitSmartPaste, | 765   std::string empty; | 
| 766                                   scoped_refptr<base::RefCountedMemory>()); | 766   aurax11_details_->InsertMapping( | 
|  | 767       kMimeTypeWebkitSmartPaste, | 
|  | 768       scoped_refptr<base::RefCountedMemory>( | 
|  | 769           base::RefCountedString::TakeString(&empty))); | 
| 767 } | 770 } | 
| 768 | 771 | 
| 769 void Clipboard::WriteBitmap(const SkBitmap& bitmap) { | 772 void Clipboard::WriteBitmap(const SkBitmap& bitmap) { | 
| 770   // Encode the bitmap as a PNG for transport. | 773   // Encode the bitmap as a PNG for transport. | 
| 771   std::vector<unsigned char> output; | 774   std::vector<unsigned char> output; | 
| 772   if (gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, false, &output)) { | 775   if (gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, false, &output)) { | 
| 773     aurax11_details_->InsertMapping(kMimeTypePNG, | 776     aurax11_details_->InsertMapping(kMimeTypePNG, | 
| 774                                     base::RefCountedBytes::TakeVector( | 777                                     base::RefCountedBytes::TakeVector( | 
| 775                                         &output)); | 778                                         &output)); | 
| 776   } | 779   } | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 859   return type; | 862   return type; | 
| 860 } | 863 } | 
| 861 | 864 | 
| 862 // static | 865 // static | 
| 863 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { | 866 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { | 
| 864   CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); | 867   CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); | 
| 865   return type; | 868   return type; | 
| 866 } | 869 } | 
| 867 | 870 | 
| 868 }  // namespace ui | 871 }  // namespace ui | 
| OLD | NEW | 
|---|