| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // This handles the case where a renderer close call was deferred | 73 // This handles the case where a renderer close call was deferred |
| 74 // while the user was operating a UI control which resulted in a | 74 // while the user was operating a UI control which resulted in a |
| 75 // close. In that case, the Cocoa view outlives the | 75 // close. In that case, the Cocoa view outlives the |
| 76 // TabContentsViewMac instance due to Cocoa retain count. | 76 // TabContentsViewMac instance due to Cocoa retain count. |
| 77 [cocoa_view_ cancelDeferredClose]; | 77 [cocoa_view_ cancelDeferredClose]; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void TabContentsViewMac::CreateView(const gfx::Size& initial_size) { | 80 void TabContentsViewMac::CreateView(const gfx::Size& initial_size) { |
| 81 TabContentsViewCocoa* view = | 81 TabContentsViewCocoa* view = |
| 82 [[TabContentsViewCocoa alloc] initWithTabContentsViewMac:this]; | 82 [[TabContentsViewCocoa alloc] initWithTabContentsViewMac:this]; |
| 83 [view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; |
| 83 cocoa_view_.reset(view); | 84 cocoa_view_.reset(view); |
| 84 } | 85 } |
| 85 | 86 |
| 86 RenderWidgetHostView* TabContentsViewMac::CreateViewForWidget( | 87 RenderWidgetHostView* TabContentsViewMac::CreateViewForWidget( |
| 87 RenderWidgetHost* render_widget_host) { | 88 RenderWidgetHost* render_widget_host) { |
| 88 if (render_widget_host->view()) { | 89 if (render_widget_host->view()) { |
| 89 // During testing, the view will already be set up in most cases to the | 90 // During testing, the view will already be set up in most cases to the |
| 90 // test view, so we don't want to clobber it with a real one. To verify that | 91 // test view, so we don't want to clobber it with a real one. To verify that |
| 91 // this actually is happening (and somebody isn't accidentally creating the | 92 // this actually is happening (and somebody isn't accidentally creating the |
| 92 // view twice), we check for the RVH Factory, which will be set when we're | 93 // view twice), we check for the RVH Factory, which will be set when we're |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 [NSObject cancelPreviousPerformRequestsWithTarget:self | 465 [NSObject cancelPreviousPerformRequestsWithTarget:self |
| 465 selector:aSel | 466 selector:aSel |
| 466 object:nil]; | 467 object:nil]; |
| 467 } | 468 } |
| 468 | 469 |
| 469 - (void)closeTabAfterEvent { | 470 - (void)closeTabAfterEvent { |
| 470 tabContentsView_->CloseTab(); | 471 tabContentsView_->CloseTab(); |
| 471 } | 472 } |
| 472 | 473 |
| 473 @end | 474 @end |
| OLD | NEW |