| 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_mac.h" | 5 #include "ui/base/clipboard/clipboard_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
| 13 #include "base/mac/scoped_cftyperef.h" | 13 #include "base/mac/scoped_cftyperef.h" |
| 14 #import "base/mac/scoped_nsexception_enabler.h" | 14 #import "base/mac/scoped_nsexception_enabler.h" |
| 15 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/strings/sys_string_conversions.h" | 17 #include "base/strings/sys_string_conversions.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "skia/ext/skia_utils_mac.h" | 19 #include "skia/ext/skia_utils_mac.h" |
| 20 #import "third_party/mozilla/NSPasteboard+Utils.h" | 20 #import "third_party/mozilla/NSPasteboard+Utils.h" |
| 21 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
| 22 #include "ui/base/clipboard/custom_data_helper.h" | 22 #include "ui/base/clipboard/custom_data_helper.h" |
| 23 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/geometry/size.h" |
| 24 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 25 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 25 #include "ui/gfx/size.h" | |
| 26 | 26 |
| 27 namespace ui { | 27 namespace ui { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Would be nice if this were in UTCoreTypes.h, but it isn't | 31 // Would be nice if this were in UTCoreTypes.h, but it isn't |
| 32 NSString* const kUTTypeURLName = @"public.url-name"; | 32 NSString* const kUTTypeURLName = @"public.url-name"; |
| 33 | 33 |
| 34 // Tells us if WebKit was the last to write to the pasteboard. There's no | 34 // Tells us if WebKit was the last to write to the pasteboard. There's no |
| 35 // actual data associated with this type. | 35 // actual data associated with this type. |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // Write an extra flavor that signifies WebKit was the last to modify the | 448 // Write an extra flavor that signifies WebKit was the last to modify the |
| 449 // pasteboard. This flavor has no data. | 449 // pasteboard. This flavor has no data. |
| 450 void ClipboardMac::WriteWebSmartPaste() { | 450 void ClipboardMac::WriteWebSmartPaste() { |
| 451 NSPasteboard* pb = GetPasteboard(); | 451 NSPasteboard* pb = GetPasteboard(); |
| 452 NSString* format = GetWebKitSmartPasteFormatType().ToNSString(); | 452 NSString* format = GetWebKitSmartPasteFormatType().ToNSString(); |
| 453 [pb addTypes:[NSArray arrayWithObject:format] owner:nil]; | 453 [pb addTypes:[NSArray arrayWithObject:format] owner:nil]; |
| 454 [pb setData:nil forType:format]; | 454 [pb setData:nil forType:format]; |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace ui | 457 } // namespace ui |
| OLD | NEW |