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 "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 if ([subviews count] == 0) { | 222 if ([subviews count] == 0) { |
223 [contentsContainer addSubview:contentsNativeView]; | 223 [contentsContainer addSubview:contentsNativeView]; |
224 } else if ([subviews objectAtIndex:0] != contentsNativeView) { | 224 } else if ([subviews objectAtIndex:0] != contentsNativeView) { |
225 [contentsContainer replaceSubview:[subviews objectAtIndex:0] | 225 [contentsContainer replaceSubview:[subviews objectAtIndex:0] |
226 with:contentsNativeView]; | 226 with:contentsNativeView]; |
227 } | 227 } |
228 [contentsNativeView setAutoresizingMask:NSViewWidthSizable| | 228 [contentsNativeView setAutoresizingMask:NSViewWidthSizable| |
229 NSViewHeightSizable]; | 229 NSViewHeightSizable]; |
230 | 230 |
231 [contentsContainer setNeedsDisplay:YES]; | 231 [contentsContainer setNeedsDisplay:YES]; |
232 | |
233 // The rendering path with overlapping views disabled causes bugs when | |
234 // transitioning between composited and non-composited mode. | |
235 // http://crbug.com/279472 | |
236 if (!fullscreenView) | |
237 contents_->SetAllowOverlappingViews(true); | |
238 } | 232 } |
239 | 233 |
240 - (void)changeWebContents:(WebContents*)newContents { | 234 - (void)changeWebContents:(WebContents*)newContents { |
241 contents_ = newContents; | 235 contents_ = newContents; |
242 fullscreenObserver_->Observe(contents_); | 236 fullscreenObserver_->Observe(contents_); |
243 isEmbeddingFullscreenWidget_ = | 237 isEmbeddingFullscreenWidget_ = |
244 contents_ && contents_->GetFullscreenRenderWidgetHostView(); | 238 contents_ && contents_->GetFullscreenRenderWidgetHostView(); |
245 } | 239 } |
246 | 240 |
247 // Returns YES if the tab represented by this controller is the front-most. | 241 // Returns YES if the tab represented by this controller is the front-most. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } else { | 337 } else { |
344 rect.ClampToCenteredSize(gfx::Size( | 338 rect.ClampToCenteredSize(gfx::Size( |
345 static_cast<int>(x / captureSize.height()), rect.height())); | 339 static_cast<int>(x / captureSize.height()), rect.height())); |
346 } | 340 } |
347 } | 341 } |
348 | 342 |
349 return NSRectFromCGRect(rect.ToCGRect()); | 343 return NSRectFromCGRect(rect.ToCGRect()); |
350 } | 344 } |
351 | 345 |
352 @end | 346 @end |
OLD | NEW |