| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_aura.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "apps/ui/views/app_window_frame_view.h" | 9 #include "apps/ui/views/app_window_frame_view.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit( | 56 void ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit( |
| 57 const AppWindow::CreateParams& create_params, | 57 const AppWindow::CreateParams& create_params, |
| 58 views::Widget::InitParams* init_params, | 58 views::Widget::InitParams* init_params, |
| 59 views::Widget* widget) { | 59 views::Widget* widget) { |
| 60 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 60 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 61 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( | 61 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( |
| 62 app_window()->extension_id()); | 62 app_window()->extension_id()); |
| 63 // Set up a custom WM_CLASS for app windows. This allows task switchers in | 63 // Set up a custom WM_CLASS for app windows. This allows task switchers in |
| 64 // X11 environments to distinguish them from main browser windows. | 64 // X11 environments to distinguish them from main browser windows. |
| 65 init_params->wm_class_name = web_app::GetWMClassFromAppName(app_name); | 65 init_params->wm_class_name = web_app::GetWMClassFromAppName(app_name); |
| 66 init_params->wm_class_class = shell_integration_linux::GetProgramClassName(); | 66 init_params->wm_class_class = shell_integration_linux::GetProgramClassClass(); |
| 67 const char kX11WindowRoleApp[] = "app"; | 67 const char kX11WindowRoleApp[] = "app"; |
| 68 init_params->wm_role_name = std::string(kX11WindowRoleApp); | 68 init_params->wm_role_name = std::string(kX11WindowRoleApp); |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 ChromeNativeAppWindowViews::OnBeforeWidgetInit(create_params, init_params, | 71 ChromeNativeAppWindowViews::OnBeforeWidgetInit(create_params, init_params, |
| 72 widget); | 72 widget); |
| 73 } | 73 } |
| 74 | 74 |
| 75 views::NonClientFrameView* | 75 views::NonClientFrameView* |
| 76 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { | 76 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ChromeNativeAppWindowViews::UpdateShape(std::move(region)); | 125 ChromeNativeAppWindowViews::UpdateShape(std::move(region)); |
| 126 | 126 |
| 127 aura::Window* native_window = widget()->GetNativeWindow(); | 127 aura::Window* native_window = widget()->GetNativeWindow(); |
| 128 if (shape() && !had_shape) { | 128 if (shape() && !had_shape) { |
| 129 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( | 129 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
| 130 new ShapedAppWindowTargeter(native_window, this))); | 130 new ShapedAppWindowTargeter(native_window, this))); |
| 131 } else if (!shape() && had_shape) { | 131 } else if (!shape() && had_shape) { |
| 132 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>()); | 132 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>()); |
| 133 } | 133 } |
| 134 } | 134 } |
| OLD | NEW |