summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/browser.h1
-rw-r--r--chrome/browser/ui/gtk/browser_window_gtk.cc11
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index ddb5f0a1..232c2e7 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -176,6 +176,7 @@ class Browser : public TabHandlerDelegate,
// Accessors ////////////////////////////////////////////////////////////////
Type type() const { return type_; }
+ const std::string& app_name() const { return app_name_; }
Profile* profile() const { return profile_; }
const std::vector<std::wstring>& user_data_dir_profiles() const;
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index e1b5986..2f4b7a9 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