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 bool active) { | 255 bool active) { |
256 app_window_->OnNativeWindowChanged(); | 256 app_window_->OnNativeWindowChanged(); |
257 if (active) | 257 if (active) |
258 app_window_->OnNativeWindowActivated(); | 258 app_window_->OnNativeWindowActivated(); |
259 } | 259 } |
260 | 260 |
261 // WebContentsObserver implementation. | 261 // WebContentsObserver implementation. |
262 | 262 |
263 void NativeAppWindowViews::RenderViewCreated( | 263 void NativeAppWindowViews::RenderViewCreated( |
264 content::RenderViewHost* render_view_host) { | 264 content::RenderViewHost* render_view_host) { |
265 if (app_window_->requested_transparent_background() && | 265 if (app_window_->requested_alpha_enabled() && CanHaveAlphaEnabled()) { |
266 CanHaveAlphaEnabled()) { | |
267 content::RenderWidgetHostView* view = render_view_host->GetView(); | 266 content::RenderWidgetHostView* view = render_view_host->GetView(); |
268 DCHECK(view); | 267 DCHECK(view); |
269 view->SetBackgroundOpaque(false); | 268 view->SetBackgroundOpaque(false); |
270 } | 269 } |
271 } | 270 } |
272 | 271 |
273 void NativeAppWindowViews::RenderViewHostChanged( | 272 void NativeAppWindowViews::RenderViewHostChanged( |
274 content::RenderViewHost* old_host, | 273 content::RenderViewHost* old_host, |
275 content::RenderViewHost* new_host) { | 274 content::RenderViewHost* new_host) { |
276 OnViewWasResized(); | 275 OnViewWasResized(); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 const gfx::Size& min_size, const gfx::Size& max_size) { | 398 const gfx::Size& min_size, const gfx::Size& max_size) { |
400 size_constraints_.set_minimum_size(min_size); | 399 size_constraints_.set_minimum_size(min_size); |
401 size_constraints_.set_maximum_size(max_size); | 400 size_constraints_.set_maximum_size(max_size); |
402 } | 401 } |
403 | 402 |
404 bool NativeAppWindowViews::CanHaveAlphaEnabled() const { | 403 bool NativeAppWindowViews::CanHaveAlphaEnabled() const { |
405 return widget_->IsTranslucentWindowOpacitySupported(); | 404 return widget_->IsTranslucentWindowOpacitySupported(); |
406 } | 405 } |
407 | 406 |
408 } // namespace apps | 407 } // namespace apps |
OLD | NEW |