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/tab_contents/web_contents_view_mac.h" | 7 #import "content/browser/tab_contents/web_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 void WebContentsViewMac::CreateView(const gfx::Size& initial_size) { | 88 void WebContentsViewMac::CreateView(const gfx::Size& initial_size) { |
89 WebContentsViewCocoa* view = | 89 WebContentsViewCocoa* view = |
90 [[WebContentsViewCocoa alloc] initWithWebContentsViewMac:this]; | 90 [[WebContentsViewCocoa alloc] initWithWebContentsViewMac:this]; |
91 cocoa_view_.reset(view); | 91 cocoa_view_.reset(view); |
92 } | 92 } |
93 | 93 |
94 RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( | 94 RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( |
95 RenderWidgetHost* render_widget_host) { | 95 RenderWidgetHost* render_widget_host) { |
96 if (render_widget_host->view()) { | 96 if (render_widget_host->GetView()) { |
97 // During testing, the view will already be set up in most cases to the | 97 // During testing, the view will already be set up in most cases to the |
98 // test view, so we don't want to clobber it with a real one. To verify that | 98 // test view, so we don't want to clobber it with a real one. To verify that |
99 // this actually is happening (and somebody isn't accidentally creating the | 99 // this actually is happening (and somebody isn't accidentally creating the |
100 // view twice), we check for the RVH Factory, which will be set when we're | 100 // view twice), we check for the RVH Factory, which will be set when we're |
101 // making special ones (which go along with the special views). | 101 // making special ones (which go along with the special views). |
102 DCHECK(RenderViewHostFactory::has_factory()); | 102 DCHECK(RenderViewHostFactory::has_factory()); |
103 return render_widget_host->view(); | 103 return render_widget_host->GetView(); |
104 } | 104 } |
105 | 105 |
106 RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>( | 106 RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>( |
107 RenderWidgetHostView::CreateViewForWidget(render_widget_host)); | 107 RenderWidgetHostView::CreateViewForWidget(render_widget_host)); |
108 if (delegate()) { | 108 if (delegate()) { |
109 NSObject<RenderWidgetHostViewMacDelegate>* rw_delegate = | 109 NSObject<RenderWidgetHostViewMacDelegate>* rw_delegate = |
110 delegate()->CreateRenderWidgetHostViewDelegate(render_widget_host); | 110 delegate()->CreateRenderWidgetHostViewDelegate(render_widget_host); |
111 view->SetDelegate(rw_delegate); | 111 view->SetDelegate(rw_delegate); |
112 } | 112 } |
113 | 113 |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 [[[notification userInfo] objectForKey:kSelectionDirection] | 605 [[[notification userInfo] objectForKey:kSelectionDirection] |
606 unsignedIntegerValue]; | 606 unsignedIntegerValue]; |
607 if (direction == NSDirectSelection) | 607 if (direction == NSDirectSelection) |
608 return; | 608 return; |
609 | 609 |
610 [self tabContents]-> | 610 [self tabContents]-> |
611 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 611 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
612 } | 612 } |
613 | 613 |
614 @end | 614 @end |
OLD | NEW |