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 "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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( | 208 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( |
209 app_window()->extension_id()); | 209 app_window()->extension_id()); |
210 | 210 |
211 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); | 211 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
212 init_params.delegate = this; | 212 init_params.delegate = this; |
213 init_params.remove_standard_frame = IsFrameless() || has_frame_color_; | 213 init_params.remove_standard_frame = IsFrameless() || has_frame_color_; |
214 init_params.use_system_default_icon = true; | 214 init_params.use_system_default_icon = true; |
215 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically | 215 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically |
216 // could plumb context through to here in some cases. | 216 // could plumb context through to here in some cases. |
217 init_params.top_level = true; | 217 init_params.top_level = true; |
218 if (create_params.transparent_background) | 218 if (create_params.alpha_enabled) |
219 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 219 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
220 init_params.keep_on_top = create_params.always_on_top; | 220 init_params.keep_on_top = create_params.always_on_top; |
221 | 221 |
222 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 222 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
223 // Set up a custom WM_CLASS for app windows. This allows task switchers in | 223 // Set up a custom WM_CLASS for app windows. This allows task switchers in |
224 // X11 environments to distinguish them from main browser windows. | 224 // X11 environments to distinguish them from main browser windows. |
225 init_params.wm_class_name = web_app::GetWMClassFromAppName(app_name); | 225 init_params.wm_class_name = web_app::GetWMClassFromAppName(app_name); |
226 init_params.wm_class_class = ShellIntegrationLinux::GetProgramClassName(); | 226 init_params.wm_class_class = ShellIntegrationLinux::GetProgramClassName(); |
227 const char kX11WindowRoleApp[] = "app"; | 227 const char kX11WindowRoleApp[] = "app"; |
228 init_params.wm_role_name = std::string(kX11WindowRoleApp); | 228 init_params.wm_role_name = std::string(kX11WindowRoleApp); |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 InitializePanelWindow(create_params); | 718 InitializePanelWindow(create_params); |
719 } else { | 719 } else { |
720 InitializeDefaultWindow(create_params); | 720 InitializeDefaultWindow(create_params); |
721 } | 721 } |
722 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 722 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
723 Profile::FromBrowserContext(app_window->browser_context()), | 723 Profile::FromBrowserContext(app_window->browser_context()), |
724 widget()->GetFocusManager(), | 724 widget()->GetFocusManager(), |
725 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 725 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
726 NULL)); | 726 NULL)); |
727 } | 727 } |
OLD | NEW |