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

Unified Diff: chrome/browser/ui/gtk/xfwm_titlebar_listener.h

Issue 11338028: Add support for XFWM titlebar buttons. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/ui/gtk/xfwm_titlebar_listener.h
===================================================================
--- chrome/browser/ui/gtk/xfwm_titlebar_listener.h (revision 0)
+++ chrome/browser/ui/gtk/xfwm_titlebar_listener.h (revision 0)
@@ -0,0 +1,71 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_XFWM_TITLEBAR_LISTENER_H_
+#define CHROME_BROWSER_UI_GTK_XFWM_TITLEBAR_LISTENER_H_
+
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+#include "base/synchronization/waitable_event.h"
+#include "chrome/browser/ui/gtk/titlebar_listener.h"
+
+namespace dbus {
+class Bus;
+class ObjectProxy;
+class Response;
+class Signal;
+}
+
+// On XFCE desktops, watch the XFWM config file for button order changes.
+class XfwmTitlebarListener : public TitlebarListener::Delegate {
+ public:
+ XfwmTitlebarListener();
+
+ private:
+ // Refcounted.
+ ~XfwmTitlebarListener();
+
+ // TitlebarListener::Delegate implementation.
+ virtual bool Init() OVERRIDE;
+ virtual std::string GetCurrentValue() OVERRIDE;
+
+ // Callback for the Xfconf "property changed" signal connection setup.
+ void OnPropertyChangedSignalConnected(const std::string& interface,
+ const std::string& signal,
+ bool succeeded);
+
+ // Called whenever a Xfconf property changes.
+ void OnPropertyChangedSignal(dbus::Signal* signal);
+
+ // Get the current button settings from Xfconf in a blocking manner on
+ // the FILE thread. On success, set |succeeded| to true and put the current
+ // settings in |result|. Otherwise set |succeeded| to false.
+ void GetCurrentButtonSettingOnFileThread(bool* succeeded,
+ std::string* result);
+
+ // DBus handle for communication with Xfconf.
+ scoped_refptr<dbus::Bus> session_bus_;
+
+ // Object proxy for Xfcont. We do not own this.
+ dbus::ObjectProxy* object_proxy_;
+
+ // An event used to make the UI thread wait during initialization until the
+ // current DBus setting has been retrieved.
+ base::WaitableEvent init_event_;
+
+ // The current button ordering in the Metacity button ordering format.
+ // It comes from Xfcont over DBus and gets converted to the Metacity format.
+ // Only accessed on the UI thread.
+ std::string current_value_;
+
+ // Note: This should remain the last member so it'll be destroyed and
+ // invalidate its weak pointers before any other members are destroyed.
+ base::WeakPtrFactory<XfwmTitlebarListener> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(XfwmTitlebarListener);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_XFWM_TITLEBAR_LISTENER_H_
Property changes on: chrome/browser/ui/gtk/xfwm_titlebar_listener.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698