OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "apps/ui/views/native_app_window_views.h" | 5 #include "apps/ui/views/native_app_window_views.h" |
6 | 6 |
7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 app_window_->OnNativeWindowChanged(); | 255 app_window_->OnNativeWindowChanged(); |
256 if (active) | 256 if (active) |
257 app_window_->OnNativeWindowActivated(); | 257 app_window_->OnNativeWindowActivated(); |
258 } | 258 } |
259 | 259 |
260 // WebContentsObserver implementation. | 260 // WebContentsObserver implementation. |
261 | 261 |
262 void NativeAppWindowViews::RenderViewCreated( | 262 void NativeAppWindowViews::RenderViewCreated( |
263 content::RenderViewHost* render_view_host) { | 263 content::RenderViewHost* render_view_host) { |
264 if (transparent_background_) { | 264 if (transparent_background_) { |
265 // Use a background with transparency to trigger transparency in Webkit. | |
266 SkBitmap background; | |
267 background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | |
268 background.allocPixels(); | |
269 background.eraseARGB(0x00, 0x00, 0x00, 0x00); | |
270 | |
271 content::RenderWidgetHostView* view = render_view_host->GetView(); | 265 content::RenderWidgetHostView* view = render_view_host->GetView(); |
272 DCHECK(view); | 266 DCHECK(view); |
273 view->SetBackground(background); | 267 view->SetBackgroundOpaque(false); |
274 } | 268 } |
275 } | 269 } |
276 | 270 |
277 void NativeAppWindowViews::RenderViewHostChanged( | 271 void NativeAppWindowViews::RenderViewHostChanged( |
278 content::RenderViewHost* old_host, | 272 content::RenderViewHost* old_host, |
279 content::RenderViewHost* new_host) { | 273 content::RenderViewHost* new_host) { |
280 OnViewWasResized(); | 274 OnViewWasResized(); |
281 } | 275 } |
282 | 276 |
283 // views::View implementation. | 277 // views::View implementation. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return size_constraints_.GetMaximumSize(); | 393 return size_constraints_.GetMaximumSize(); |
400 } | 394 } |
401 | 395 |
402 void NativeAppWindowViews::SetContentSizeConstraints( | 396 void NativeAppWindowViews::SetContentSizeConstraints( |
403 const gfx::Size& min_size, const gfx::Size& max_size) { | 397 const gfx::Size& min_size, const gfx::Size& max_size) { |
404 size_constraints_.set_minimum_size(min_size); | 398 size_constraints_.set_minimum_size(min_size); |
405 size_constraints_.set_maximum_size(max_size); | 399 size_constraints_.set_maximum_size(max_size); |
406 } | 400 } |
407 | 401 |
408 } // namespace apps | 402 } // namespace apps |
OLD | NEW |