diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.h | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/gconf_titlebar_listener.cc | 10 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 6 |
4 files changed, 24 insertions, 7 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index dea24e6..77adb09 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) { diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h index c6da855..5cd30e6 100644 --- a/chrome/browser/gtk/browser_titlebar.h +++ b/chrome/browser/gtk/browser_titlebar.h @@ -31,6 +31,10 @@ class BrowserTitlebar : public NotificationObserver, public ActiveWindowWatcherX::Observer, public menus::SimpleMenuModel::Delegate { public: + // A default button order string for when we aren't asking gconf for the + // metacity configuration. + static const char kDefaultButtonString[]; + BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window); virtual ~BrowserTitlebar(); diff --git a/chrome/browser/gtk/gconf_titlebar_listener.cc b/chrome/browser/gtk/gconf_titlebar_listener.cc index 81b5ef0..237332f 100644 --- a/chrome/browser/gtk/gconf_titlebar_listener.cc +++ b/chrome/browser/gtk/gconf_titlebar_listener.cc @@ -13,10 +13,6 @@ namespace { -// A default button order string for when we aren't asking gconf for the -// metacity configuration. -const char* kDefaultButtonPlacement = ":minimize,maximize,close"; - // The GConf key we read for the button placement string. Even through the key // has "metacity" in it, it's shared between metacity and compiz. const char* kButtonLayoutKey = "/apps/metacity/general/button_layout"; @@ -34,7 +30,7 @@ void GConfTitlebarListener::SetTitlebarButtons(BrowserTitlebar* titlebar) { titlebar->BuildButtons(current_value_); titlebars_.insert(titlebar); } else { - titlebar->BuildButtons(kDefaultButtonPlacement); + titlebar->BuildButtons(BrowserTitlebar::kDefaultButtonString); } } @@ -113,8 +109,8 @@ bool GConfTitlebarListener::HandleGError(GError* error, const char* key) { void GConfTitlebarListener::ParseAndStoreValue(GConfValue* gconf_value) { if (gconf_value) { const char* value = gconf_value_get_string(gconf_value); - current_value_ = value ? value : kDefaultButtonPlacement; + current_value_ = value ? value : BrowserTitlebar::kDefaultButtonString; } else { - current_value_ = kDefaultButtonPlacement; + current_value_ = BrowserTitlebar::kDefaultButtonString; } } diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 88e1448..9fc4fb7 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3405,6 +3405,12 @@ ], }, }], + ['use_gconf==0', { + 'sources!': [ + 'browser/gtk/gconf_titlebar_listener.cc', + 'browser/gtk/gconf_titlebar_listener.h', + ], + }], ['use_gnome_keyring==0', { 'sources!': [ 'browser/password_manager/native_backend_gnome_x.h', |