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

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 23093020: Set the WM_CLASS property of X11 windows in Linux Aura build. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to reviews. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/shell_integration_linux.cc
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index b19fd2e25fe784fa06fe97810c9a8e1607853803..820927b0528acb77cca0624ff3115e77c22b4160 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -545,6 +545,16 @@ std::vector<base::FilePath> GetDataSearchLocations(base::Environment* env) {
return search_paths;
}
+std::string GetProgramClassName() {
+ DCHECK(CommandLine::InitializedForCurrentProcess());
+ // Get the res_name component from argv[0].
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ std::string class_name = command_line->GetProgram().BaseName().value();
+ if (!class_name.empty())
+ class_name[0] = base::ToUpperASCII(class_name[0]);
+ return class_name;
+}
+
std::string GetDesktopName(base::Environment* env) {
#if defined(GOOGLE_CHROME_BUILD)
return "google-chrome.desktop";
@@ -761,11 +771,9 @@ std::string GetDesktopFileContents(
if (no_display)
g_key_file_set_string(key_file, kDesktopEntry, "NoDisplay", "true");
-#if defined(TOOLKIT_GTK)
std::string wmclass = web_app::GetWMClassFromAppName(app_name);
g_key_file_set_string(key_file, kDesktopEntry, "StartupWMClass",
wmclass.c_str());
-#endif
gsize length = 0;
gchar* data_dump = g_key_file_to_data(key_file, &length, NULL);

Powered by Google App Engine
This is Rietveld 408576698