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

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 190533006: Add support for transparent background API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename transparentBackground to alphaEnabled Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
6 6
7 #include "apps/ui/views/app_window_frame_view.h" 7 #include "apps/ui/views/app_window_frame_view.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/app_mode/app_mode_utils.h" 10 #include "chrome/browser/app_mode/app_mode_utils.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( 207 std::string app_name = web_app::GenerateApplicationNameFromExtensionId(
208 app_window()->extension_id()); 208 app_window()->extension_id());
209 209
210 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); 210 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW);
211 init_params.delegate = this; 211 init_params.delegate = this;
212 init_params.remove_standard_frame = IsFrameless() || has_frame_color_; 212 init_params.remove_standard_frame = IsFrameless() || has_frame_color_;
213 init_params.use_system_default_icon = true; 213 init_params.use_system_default_icon = true;
214 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically 214 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically
215 // could plumb context through to here in some cases. 215 // could plumb context through to here in some cases.
216 init_params.top_level = true; 216 init_params.top_level = true;
217 if (create_params.transparent_background) 217 if (create_params.alpha_enabled)
218 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 218 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
219 init_params.keep_on_top = create_params.always_on_top; 219 init_params.keep_on_top = create_params.always_on_top;
220 220
221 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 221 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
222 // Set up a custom WM_CLASS for app windows. This allows task switchers in 222 // Set up a custom WM_CLASS for app windows. This allows task switchers in
223 // X11 environments to distinguish them from main browser windows. 223 // X11 environments to distinguish them from main browser windows.
224 init_params.wm_class_name = web_app::GetWMClassFromAppName(app_name); 224 init_params.wm_class_name = web_app::GetWMClassFromAppName(app_name);
225 init_params.wm_class_class = ShellIntegrationLinux::GetProgramClassName(); 225 init_params.wm_class_class = ShellIntegrationLinux::GetProgramClassName();
226 const char kX11WindowRoleApp[] = "app"; 226 const char kX11WindowRoleApp[] = "app";
227 init_params.wm_role_name = std::string(kX11WindowRoleApp); 227 init_params.wm_role_name = std::string(kX11WindowRoleApp);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 InitializePanelWindow(create_params); 696 InitializePanelWindow(create_params);
697 } else { 697 } else {
698 InitializeDefaultWindow(create_params); 698 InitializeDefaultWindow(create_params);
699 } 699 }
700 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 700 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
701 Profile::FromBrowserContext(app_window->browser_context()), 701 Profile::FromBrowserContext(app_window->browser_context()),
702 widget()->GetFocusManager(), 702 widget()->GetFocusManager(),
703 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 703 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
704 NULL)); 704 NULL));
705 } 705 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698