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

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

Issue 2186813002: Linux: Support the --class argument (Reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert gtk2_util.cc Created 4 years, 4 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_linux_unittest.cc ('k') | chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698