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 #import "content/browser/web_contents/web_drag_dest_mac.h" | 5 #import "content/browser/web_contents/web_drag_dest_mac.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 | 8 |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
12 #include "content/public/browser/web_drag_dest_delegate.h" | 12 #include "content/public/browser/web_drag_dest_delegate.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
14 #import "third_party/mozilla/NSPasteboard+Utils.h" | 14 #import "third_party/mozilla/NSPasteboard+Utils.h" |
15 #include "ui/base/clipboard/custom_data_helper.h" | 15 #include "ui/base/clipboard/custom_data_helper.h" |
16 #import "ui/base/dragdrop/cocoa_dnd_util.h" | 16 #import "ui/base/dragdrop/cocoa_dnd_util.h" |
17 #include "webkit/glue/webdropdata.h" | 17 #include "webkit/glue/webdropdata.h" |
18 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
19 | 19 |
20 using WebKit::WebDragOperationsMask; | 20 using WebKit::WebDragOperationsMask; |
21 using content::OpenURLParams; | 21 using content::OpenURLParams; |
22 using content::Referrer; | 22 using content::Referrer; |
| 23 using content::WebContentsImpl; |
23 | 24 |
24 int GetModifierFlags() { | 25 int GetModifierFlags() { |
25 int modifier_state = 0; | 26 int modifier_state = 0; |
26 UInt32 currentModifiers = GetCurrentKeyModifiers(); | 27 UInt32 currentModifiers = GetCurrentKeyModifiers(); |
27 if (currentModifiers & ::shiftKey) | 28 if (currentModifiers & ::shiftKey) |
28 modifier_state |= WebKit::WebInputEvent::ShiftKey; | 29 modifier_state |= WebKit::WebInputEvent::ShiftKey; |
29 if (currentModifiers & ::controlKey) | 30 if (currentModifiers & ::controlKey) |
30 modifier_state |= WebKit::WebInputEvent::ControlKey; | 31 modifier_state |= WebKit::WebInputEvent::ControlKey; |
31 if (currentModifiers & ::optionKey) | 32 if (currentModifiers & ::optionKey) |
32 modifier_state |= WebKit::WebInputEvent::AltKey; | 33 modifier_state |= WebKit::WebInputEvent::AltKey; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Get custom MIME data. | 278 // Get custom MIME data. |
278 if ([types containsObject:ui::kWebCustomDataPboardType]) { | 279 if ([types containsObject:ui::kWebCustomDataPboardType]) { |
279 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType]; | 280 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType]; |
280 ui::ReadCustomDataIntoMap([customData bytes], | 281 ui::ReadCustomDataIntoMap([customData bytes], |
281 [customData length], | 282 [customData length], |
282 &data->custom_data); | 283 &data->custom_data); |
283 } | 284 } |
284 } | 285 } |
285 | 286 |
286 @end | 287 @end |
OLD | NEW |