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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 with:contentsNativeView]; | 244 with:contentsNativeView]; |
245 } | 245 } |
246 | 246 |
247 [contentsNativeView setAutoresizingMask:NSViewNotSizable]; | 247 [contentsNativeView setAutoresizingMask:NSViewNotSizable]; |
248 [contentsContainer setFrame:[superview bounds]]; | 248 [contentsContainer setFrame:[superview bounds]]; |
249 [superview addSubview:contentsContainer]; | 249 [superview addSubview:contentsContainer]; |
250 [contentsNativeView setAutoresizingMask:NSViewWidthSizable| | 250 [contentsNativeView setAutoresizingMask:NSViewWidthSizable| |
251 NSViewHeightSizable]; | 251 NSViewHeightSizable]; |
252 | 252 |
253 [contentsContainer setNeedsDisplay:YES]; | 253 [contentsContainer setNeedsDisplay:YES]; |
254 | |
255 // Push the background color down to the RenderWidgetHostView, so that if | |
256 // there is a flash between contents appearing, it will be the theme's color, | |
257 // not white. | |
258 SkColor skBackgroundColor = SK_ColorWHITE; | |
259 const ThemeProvider* theme = [[[self view] window] themeProvider]; | |
260 if (theme) | |
261 skBackgroundColor = theme->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND); | |
262 content::RenderWidgetHostView* rwhv = contents_->GetRenderWidgetHostView(); | |
263 if (rwhv) | |
264 rwhv->SetBackgroundColor(skBackgroundColor); | |
265 } | 254 } |
266 | 255 |
267 - (void)updateFullscreenWidgetFrame { | 256 - (void)updateFullscreenWidgetFrame { |
268 // This should only apply if a fullscreen widget is embedded. | 257 // This should only apply if a fullscreen widget is embedded. |
269 if (!isEmbeddingFullscreenWidget_ || blockFullscreenResize_) | 258 if (!isEmbeddingFullscreenWidget_ || blockFullscreenResize_) |
270 return; | 259 return; |
271 | 260 |
272 content::RenderWidgetHostView* const fullscreenView = | 261 content::RenderWidgetHostView* const fullscreenView = |
273 contents_->GetFullscreenRenderWidgetHostView(); | 262 contents_->GetFullscreenRenderWidgetHostView(); |
274 if (fullscreenView) { | 263 if (fullscreenView) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 378 |
390 - (BOOL)shouldResizeContentView { | 379 - (BOOL)shouldResizeContentView { |
391 return !isEmbeddingFullscreenWidget_ || !blockFullscreenResize_; | 380 return !isEmbeddingFullscreenWidget_ || !blockFullscreenResize_; |
392 } | 381 } |
393 | 382 |
394 - (BOOL)isPopup { | 383 - (BOOL)isPopup { |
395 return isPopup_; | 384 return isPopup_; |
396 } | 385 } |
397 | 386 |
398 @end | 387 @end |
OLD | NEW |