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

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 6647008: GTK: Set WM_CLASS to webapp names on webapp windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
« chrome/browser/ui/browser.h ('K') | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index e1b598698b978ec68b263165bf91c941e7f436f2..2f4b7a9669c98e08c2bdaf96205af51b7bf3e471 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -10,6 +10,7 @@
#include "base/base_paths.h"
#include "base/command_line.h"
+#include "base/i18n/file_util_icu.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/path_service.h"
@@ -285,6 +286,16 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser)
gtk_window_group_add_window(gtk_window_group_new(), window_);
g_object_unref(gtk_window_get_group(window_));
+ if (browser_->type() & Browser::TYPE_APP) {
+ std::string wmclassname = browser_->app_name();
+ if (wmclassname != DevToolsWindow::kDevToolsApp) {
+ file_util::ReplaceIllegalCharactersInPath(&wmclassname, '_');
+ TrimString(wmclassname, "_", &wmclassname);
+ gtk_window_set_wmclass(window_, wmclassname.c_str(),
+ wmclassname.c_str());
+ }
+ }
+
// For popups, we initialize widgets then set the window geometry, because
// popups need the widgets inited before they can set the window size
// properly. For other windows, we set the geometry first to prevent resize
« chrome/browser/ui/browser.h ('K') | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698