OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/browser_shutdown.h" | 11 #include "chrome/browser/browser_shutdown.h" |
12 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" | 12 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" |
13 #include "chrome/browser/tab_contents/render_view_context_menu_mac.h" | 13 #include "chrome/browser/tab_contents/render_view_context_menu_mac.h" |
14 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h" | 14 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h" |
15 #import "chrome/browser/ui/cocoa/focus_tracker.h" | 15 #import "chrome/browser/ui/cocoa/focus_tracker.h" |
16 #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" | 16 #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" |
17 #import "chrome/browser/ui/cocoa/tab_contents/web_drop_target.h" | |
18 #import "chrome/browser/ui/cocoa/view_id_util.h" | 17 #import "chrome/browser/ui/cocoa/view_id_util.h" |
19 #include "content/browser/renderer_host/render_view_host.h" | 18 #include "content/browser/renderer_host/render_view_host.h" |
20 #include "content/browser/renderer_host/render_view_host_factory.h" | 19 #include "content/browser/renderer_host/render_view_host_factory.h" |
21 #include "content/browser/renderer_host/render_widget_host.h" | 20 #include "content/browser/renderer_host/render_widget_host.h" |
22 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 21 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
23 #include "content/browser/tab_contents/popup_menu_helper_mac.h" | 22 #include "content/browser/tab_contents/popup_menu_helper_mac.h" |
24 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
25 #include "content/browser/tab_contents/tab_contents_delegate.h" | 24 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 25 #import "content/browser/tab_contents/web_drag_dest_mac.h" |
26 #import "content/browser/tab_contents/web_drag_source_mac.h" | 26 #import "content/browser/tab_contents/web_drag_source_mac.h" |
27 #import "content/common/chrome_application_mac.h" | 27 #import "content/common/chrome_application_mac.h" |
28 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
29 #include "content/public/browser/notification_details.h" | 29 #include "content/public/browser/notification_details.h" |
30 #include "content/public/browser/notification_source.h" | 30 #include "content/public/browser/notification_source.h" |
31 #include "content/public/browser/notification_types.h" | 31 #include "content/public/browser/notification_types.h" |
32 #include "skia/ext/skia_utils_mac.h" | 32 #include "skia/ext/skia_utils_mac.h" |
33 #import "third_party/mozilla/NSPasteboard+Utils.h" | 33 #import "third_party/mozilla/NSPasteboard+Utils.h" |
34 | 34 |
35 using WebKit::WebDragOperation; | 35 using WebKit::WebDragOperation; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } | 413 } |
414 } | 414 } |
415 | 415 |
416 @implementation TabContentsViewCocoa | 416 @implementation TabContentsViewCocoa |
417 | 417 |
418 - (id)initWithTabContentsViewMac:(TabContentsViewMac*)w { | 418 - (id)initWithTabContentsViewMac:(TabContentsViewMac*)w { |
419 self = [super initWithFrame:NSZeroRect]; | 419 self = [super initWithFrame:NSZeroRect]; |
420 if (self != nil) { | 420 if (self != nil) { |
421 tabContentsView_ = w; | 421 tabContentsView_ = w; |
422 dropTarget_.reset( | 422 dropTarget_.reset( |
423 [[WebDropTarget alloc] initWithTabContents:[self tabContents]]); | 423 [[WebDragDest alloc] initWithTabContents:[self tabContents]]); |
424 bookmarkHandler_.reset(new WebDragBookmarkHandlerMac); | 424 bookmarkHandler_.reset(new WebDragBookmarkHandlerMac); |
425 [dropTarget_ setDragDelegate: | 425 [dropTarget_ setDragDelegate: |
426 static_cast<content::WebDragDestDelegate*>(bookmarkHandler_.get())]; | 426 static_cast<content::WebDragDestDelegate*>(bookmarkHandler_.get())]; |
427 [self registerDragTypes]; | 427 [self registerDragTypes]; |
428 // TabContentsViewCocoa's ViewID may be changed to VIEW_ID_DEV_TOOLS_DOCKED | 428 // TabContentsViewCocoa's ViewID may be changed to VIEW_ID_DEV_TOOLS_DOCKED |
429 // by TabContentsController, so we can't just override -viewID method to | 429 // by TabContentsController, so we can't just override -viewID method to |
430 // return it. | 430 // return it. |
431 view_id_util::SetID(self, VIEW_ID_TAB_CONTAINER); | 431 view_id_util::SetID(self, VIEW_ID_TAB_CONTAINER); |
432 | 432 |
433 [[NSNotificationCenter defaultCenter] | 433 [[NSNotificationCenter defaultCenter] |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 [[[notification userInfo] objectForKey:kSelectionDirection] | 596 [[[notification userInfo] objectForKey:kSelectionDirection] |
597 unsignedIntegerValue]; | 597 unsignedIntegerValue]; |
598 if (direction == NSDirectSelection) | 598 if (direction == NSDirectSelection) |
599 return; | 599 return; |
600 | 600 |
601 [self tabContents]-> | 601 [self tabContents]-> |
602 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 602 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
603 } | 603 } |
604 | 604 |
605 @end | 605 @end |
OLD | NEW |