| 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
|
|
|
|
|