Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2599)

Unified Diff: apps/ui/views/native_app_window_views.cc

Issue 375183002: Add app.window.alphaEnabled() and onAlphaEnabledChanged. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: apps/ui/views/native_app_window_views.cc
diff --git a/apps/ui/views/native_app_window_views.cc b/apps/ui/views/native_app_window_views.cc
index 62b941d9e58db4628f080934c6bf49b1660b76a8..5fdbc4e839d66be40fdb860803477cc4d0ef58bb 100644
--- a/apps/ui/views/native_app_window_views.cc
+++ b/apps/ui/views/native_app_window_views.cc
@@ -27,14 +27,12 @@ NativeAppWindowViews::NativeAppWindowViews()
web_view_(NULL),
widget_(NULL),
frameless_(false),
- transparent_background_(false),
resizable_(false) {}
void NativeAppWindowViews::Init(AppWindow* app_window,
const AppWindow::CreateParams& create_params) {
app_window_ = app_window;
frameless_ = create_params.frame == AppWindow::FRAME_NONE;
- transparent_background_ = create_params.transparent_background;
resizable_ = create_params.resizable;
size_constraints_.set_minimum_size(
create_params.GetContentMinimumSize(gfx::Insets()));
@@ -260,7 +258,8 @@ void NativeAppWindowViews::OnWidgetActivationChanged(views::Widget* widget,
void NativeAppWindowViews::RenderViewCreated(
content::RenderViewHost* render_view_host) {
- if (transparent_background_) {
+ if (app_window_->RequestedTransparentBackground() &&
+ CanHaveTransparentBackground()) {
content::RenderWidgetHostView* view = render_view_host->GetView();
DCHECK(view);
view->SetBackgroundOpaque(false);
@@ -398,4 +397,12 @@ void NativeAppWindowViews::SetContentSizeConstraints(
size_constraints_.set_maximum_size(max_size);
}
+bool NativeAppWindowViews::CanHaveTransparentBackground() const {
+ return true;
Wez 2014/07/09 22:03:30 So by default we're assuming that Views can always
jackhou1 2014/07/10 03:04:18 It looks like we use ChromeNativeAppWindowViews on
Wez 2014/07/11 17:14:10 Looks plausible, but I'm no expect on views/Aura.
jackhou1 2014/07/14 03:08:12 benwells, any advice on this?
+}
+
+void NativeAppWindowViews::CanHaveTransparentBackgroundChanged() {
+ app_window_->OnNativeWindowChanged();
Wez 2014/07/09 22:03:30 Does this fix the Classic->Aero transitions?
jackhou1 2014/07/10 03:04:18 This just updates alphaEnabled in the javascript c
Wez 2014/07/11 17:14:10 Acknowledged.
+}
+
} // namespace apps

Powered by Google App Engine
This is Rietveld 408576698