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

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: Address comments 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..36542204658950758864f6c4bded6d34d771630b 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,7 @@ void NativeAppWindowViews::OnWidgetActivationChanged(views::Widget* widget,
void NativeAppWindowViews::RenderViewCreated(
content::RenderViewHost* render_view_host) {
- if (transparent_background_) {
+ if (app_window_->RequestedTransparentBackground() && CanHaveAlphaEnabled()) {
content::RenderWidgetHostView* view = render_view_host->GetView();
DCHECK(view);
view->SetBackgroundOpaque(false);
@@ -398,4 +396,12 @@ void NativeAppWindowViews::SetContentSizeConstraints(
size_constraints_.set_maximum_size(max_size);
}
+bool NativeAppWindowViews::CanHaveAlphaEnabled() const {
+ return true;
tapted 2014/07/14 03:30:24 does this work fine on desktop-linux as well as Ch
jackhou1 2014/07/14 04:51:02 This doesn't work on Linux. I think this logic s
+}
+
+void NativeAppWindowViews::CanHaveAlphaEnabledChanged() {
+ app_window_->OnNativeWindowChanged();
+}
+
} // namespace apps

Powered by Google App Engine
This is Rietveld 408576698