Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: ui/base/clipboard/clipboard_aurax11.cc

Issue 207013003: Mark drags starting in web content as tainted to avoid file path forgery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes and comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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)));
tony 2014/03/21 23:09:00 This doesn't seem related to the bug fix. If you
dcheng 2014/03/21 23:57:07 It's not directly related. I can pull it out--I di
tony 2014/03/22 00:15:05 This is fine, but please mention this in the chang
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698