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

Unified Diff: chrome/browser/gtk/browser_titlebar.cc

Issue 4691001: Make GConf dependency optional. (Closed)
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.h ('k') | chrome/browser/gtk/gconf_titlebar_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_titlebar.cc
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc
index 5ee8e858062d7b8e66e9036d7208095320551b72..563a3f3f3317eda8318c39c76075dca56c45e4d4 100644
--- a/chrome/browser/gtk/browser_titlebar.cc
+++ b/chrome/browser/gtk/browser_titlebar.cc
@@ -23,7 +23,9 @@
#include "chrome/browser/gtk/accelerators_gtk.h"
#include "chrome/browser/gtk/browser_window_gtk.h"
#include "chrome/browser/gtk/custom_button.h"
+#if defined(USE_GCONF)
#include "chrome/browser/gtk/gconf_titlebar_listener.h"
+#endif
#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/gtk/menu_gtk.h"
@@ -193,6 +195,9 @@ void PopupPageMenuModel::Build() {
////////////////////////////////////////////////////////////////////////////////
// BrowserTitlebar
+// static
+const char BrowserTitlebar::kDefaultButtonString[] = ":minimize,maximize,close";
+
BrowserTitlebar::BrowserTitlebar(BrowserWindowGtk* browser_window,
GtkWindow* window)
: browser_window_(browser_window),
@@ -299,9 +304,13 @@ void BrowserTitlebar::Init() {
gtk_box_pack_end(GTK_BOX(container_hbox_), titlebar_right_buttons_vbox_,
FALSE, FALSE, 0);
+#if defined(USE_GCONF)
// Either read the gconf database and register for updates (on GNOME), or use
// the default value (anywhere else).
Singleton<GConfTitlebarListener>()->SetTitlebarButtons(this);
+#else
+ BuildButtons(kDefaultButtonString);
+#endif
// We use an alignment to control the titlebar height.
titlebar_alignment_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
@@ -363,7 +372,9 @@ void BrowserTitlebar::Init() {
BrowserTitlebar::~BrowserTitlebar() {
ActiveWindowWatcherX::RemoveObserver(this);
+#if defined(USE_GCONF)
Singleton<GConfTitlebarListener>()->RemoveObserver(this);
+#endif
}
void BrowserTitlebar::BuildButtons(const std::string& button_string) {
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.h ('k') | chrome/browser/gtk/gconf_titlebar_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698