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

Unified Diff: chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.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, 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: chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc
diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc b/chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc
index ce1c651c139369dcda31a1689f58d61f4f87d3a9..1b180fabb119fc2efe9f2e824fb93205704186fb 100644
--- a/chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc
+++ b/chrome/browser/ui/views/frame/desktop_browser_frame_auralinux.cc
@@ -33,28 +33,20 @@ views::Widget::InitParams DesktopBrowserFrameAuraLinux::GetWidgetParams() {
// Set up a custom WM_CLASS for some sorts of window types. This allows
// task switchers in X11 environments to distinguish between main browser
// windows and e.g app windows.
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
const Browser& browser = *browser_view()->browser();
- params.wm_class_class = shell_integration_linux::GetProgramClassName();
- params.wm_class_name = params.wm_class_class;
- if (browser.is_app() && !browser.is_devtools()) {
- // This window is a hosted app or v1 packaged app.
- // NOTE: v2 packaged app windows are created by ChromeNativeAppWindowViews.
- params.wm_class_name = web_app::GetWMClassFromAppName(browser.app_name());
- } else if (command_line.HasSwitch(switches::kUserDataDir)) {
- // Set the class name to e.g. "Chrome (/tmp/my-user-data)". The
- // class name will show up in the alt-tab list in gnome-shell if
- // you're running a binary that doesn't have a matching .desktop
- // file.
- const std::string user_data_dir =
- command_line.GetSwitchValueNative(switches::kUserDataDir);
- params.wm_class_name += " (" + user_data_dir + ")";
- }
+ params.wm_class_name =
+ browser.is_app() && !browser.is_devtools()
+ ? web_app::GetWMClassFromAppName(browser.app_name())
+ // This window is a hosted app or v1 packaged app.
+ // NOTE: v2 packaged app windows are created by
+ // ChromeNativeAppWindowViews.
+ : shell_integration_linux::GetProgramClassName();
+ params.wm_class_class = shell_integration_linux::GetProgramClassClass();
const char kX11WindowRoleBrowser[] = "browser";
const char kX11WindowRolePopup[] = "pop-up";
- params.wm_role_name = browser_view()->browser()->is_type_tabbed() ?
- std::string(kX11WindowRoleBrowser) : std::string(kX11WindowRolePopup);
+ params.wm_role_name = browser_view()->browser()->is_type_tabbed()
+ ? std::string(kX11WindowRoleBrowser)
+ : std::string(kX11WindowRolePopup);
params.remove_standard_frame = UseCustomFrame();
return params;
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc ('k') | chrome/browser/ui/views/panels/panel_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698