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 <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
6 | 6 |
7 #import "content/browser/web_contents/web_contents_view_mac.h" | 7 #import "content/browser/web_contents/web_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 using content::PopupMenuHelper; | 36 using content::PopupMenuHelper; |
37 using content::RenderViewHostFactory; | 37 using content::RenderViewHostFactory; |
38 using content::RenderWidgetHostView; | 38 using content::RenderWidgetHostView; |
39 using content::RenderWidgetHostViewMac; | 39 using content::RenderWidgetHostViewMac; |
40 using content::WebContents; | 40 using content::WebContents; |
41 using content::WebContentsImpl; | 41 using content::WebContentsImpl; |
42 using content::WebContentsViewMac; | 42 using content::WebContentsViewMac; |
43 | 43 |
44 // Ensure that the blink::WebDragOperation enum values stay in sync with | 44 // Ensure that the blink::WebDragOperation enum values stay in sync with |
45 // NSDragOperation constants, since the code below static_casts between 'em. | 45 // NSDragOperation constants, since the code below static_casts between 'em. |
46 #define STATIC_ASSERT_MATCHING_ENUM(name) \ | 46 #define STATIC_ASSERT_ENUM(a, b) \ |
47 static_assert(int(NS##name) == int(blink::Web##name), "enum mismatch: " #name) | 47 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
48 STATIC_ASSERT_MATCHING_ENUM(DragOperationNone); | 48 "enum mismatch: " #a) |
49 STATIC_ASSERT_MATCHING_ENUM(DragOperationCopy); | 49 STATIC_ASSERT_ENUM(NSDragOperationNone, blink::WebDragOperationNone); |
50 STATIC_ASSERT_MATCHING_ENUM(DragOperationLink); | 50 STATIC_ASSERT_ENUM(NSDragOperationCopy, blink::WebDragOperationCopy); |
51 STATIC_ASSERT_MATCHING_ENUM(DragOperationGeneric); | 51 STATIC_ASSERT_ENUM(NSDragOperationLink, blink::WebDragOperationLink); |
52 STATIC_ASSERT_MATCHING_ENUM(DragOperationPrivate); | 52 STATIC_ASSERT_ENUM(NSDragOperationGeneric, blink::WebDragOperationGeneric); |
53 STATIC_ASSERT_MATCHING_ENUM(DragOperationMove); | 53 STATIC_ASSERT_ENUM(NSDragOperationPrivate, blink::WebDragOperationPrivate); |
54 STATIC_ASSERT_MATCHING_ENUM(DragOperationDelete); | 54 STATIC_ASSERT_ENUM(NSDragOperationMove, blink::WebDragOperationMove); |
55 STATIC_ASSERT_MATCHING_ENUM(DragOperationEvery); | 55 STATIC_ASSERT_ENUM(NSDragOperationDelete, blink::WebDragOperationDelete); |
| 56 STATIC_ASSERT_ENUM(NSDragOperationEvery, blink::WebDragOperationEvery); |
56 | 57 |
57 @interface WebContentsViewCocoa (Private) | 58 @interface WebContentsViewCocoa (Private) |
58 - (id)initWithWebContentsViewMac:(WebContentsViewMac*)w; | 59 - (id)initWithWebContentsViewMac:(WebContentsViewMac*)w; |
59 - (void)registerDragTypes; | 60 - (void)registerDragTypes; |
60 - (void)setCurrentDragOperation:(NSDragOperation)operation; | 61 - (void)setCurrentDragOperation:(NSDragOperation)operation; |
61 - (DropData*)dropData; | 62 - (DropData*)dropData; |
62 - (void)startDragWithDropData:(const DropData&)dropData | 63 - (void)startDragWithDropData:(const DropData&)dropData |
63 dragOperationMask:(NSDragOperation)operationMask | 64 dragOperationMask:(NSDragOperation)operationMask |
64 image:(NSImage*)image | 65 image:(NSImage*)image |
65 offset:(NSPoint)offset; | 66 offset:(NSPoint)offset; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 if (window && webContents && !webContents->IsBeingDestroyed()) { | 653 if (window && webContents && !webContents->IsBeingDestroyed()) { |
653 if ([window occlusionState] & NSWindowOcclusionStateVisible) { | 654 if ([window occlusionState] & NSWindowOcclusionStateVisible) { |
654 webContents->WasUnOccluded(); | 655 webContents->WasUnOccluded(); |
655 } else { | 656 } else { |
656 webContents->WasOccluded(); | 657 webContents->WasOccluded(); |
657 } | 658 } |
658 } | 659 } |
659 } | 660 } |
660 | 661 |
661 @end | 662 @end |
OLD | NEW |