summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 17:38:15 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 17:38:15 +0000
commitc7a3d40a94f95baf32907b6e834a9a7930b6fedc (patch)
tree352855511f490de95e3c665d3a7dea5587f6be30 /ui
parentd855ee3c72e1ceb4e0fca5a0506cebea9f638c7d (diff)
downloadchromium_src-c7a3d40a94f95baf32907b6e834a9a7930b6fedc.zip
chromium_src-c7a3d40a94f95baf32907b6e834a9a7930b6fedc.tar.gz
chromium_src-c7a3d40a94f95baf32907b6e834a9a7930b6fedc.tar.bz2
linux_aura: Retrieve the titlebar configuration from GConf.
Moves parts of the current GTK code that interacts with window titlebars into libgtk2ui. Plumbs this data through delegates to OpaqueBrowserFrameView. BUG=281788 R=sky@chromium.org Review URL: https://codereview.chromium.org/23480065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/linux_ui/linux_ui.cc2
-rw-r--r--ui/views/linux_ui/linux_ui.h13
-rw-r--r--ui/views/linux_ui/window_button_order_observer.h29
-rw-r--r--ui/views/views.gyp2
-rw-r--r--ui/views/window/frame_buttons.h19
5 files changed, 63 insertions, 2 deletions
diff --git a/ui/views/linux_ui/linux_ui.cc b/ui/views/linux_ui/linux_ui.cc
index 9a4dccd..79f0a40 100644
--- a/ui/views/linux_ui/linux_ui.cc
+++ b/ui/views/linux_ui/linux_ui.cc
@@ -21,7 +21,7 @@ void LinuxUI::SetInstance(LinuxUI* instance) {
LinuxShellDialog::SetInstance(instance);
}
-const LinuxUI* LinuxUI::instance() {
+LinuxUI* LinuxUI::instance() {
return g_linux_ui;
}
diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h
index 8c0bf4c..443677c8 100644
--- a/ui/views/linux_ui/linux_ui.h
+++ b/ui/views/linux_ui/linux_ui.h
@@ -22,6 +22,7 @@ class NativeTheme;
}
namespace views {
+class WindowButtonOrderObserver;
// Adapter class with targets to render like different toolkits. Set by any
// project that wants to do linux desktop native rendering.
@@ -42,7 +43,7 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxShellDialog {
//
// Can return NULL, in case no toolkit has been set. (For example, if we're
// running with the "--ash" flag.)
- static const LinuxUI* instance();
+ static LinuxUI* instance();
// Returns an themed image per theme_provider.h
virtual bool UseNativeTheme() const = 0;
@@ -70,6 +71,16 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxShellDialog {
virtual scoped_ptr<StatusIconLinux> CreateLinuxStatusIcon(
const gfx::ImageSkia& image,
const string16& tool_tip) const = 0;
+
+ // Notifies the observer about changes about how window buttons should be
+ // laid out. If the order is anything other than the default min,max,close on
+ // the right, will immediately send a button change event to the observer.
+ virtual void AddWindowButtonOrderObserver(
+ WindowButtonOrderObserver* observer) = 0;
+
+ // Removes the observer from the LinuxUI's list.
+ virtual void RemoveWindowButtonOrderObserver(
+ WindowButtonOrderObserver* observer) = 0;
};
} // namespace views
diff --git a/ui/views/linux_ui/window_button_order_observer.h b/ui/views/linux_ui/window_button_order_observer.h
new file mode 100644
index 0000000..96b7cb8
--- /dev/null
+++ b/ui/views/linux_ui/window_button_order_observer.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2013 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 UI_VIEWS_LINUX_UI_WINDOW_BUTTON_ORDER_OBSERVER_H_
+#define UI_VIEWS_LINUX_UI_WINDOW_BUTTON_ORDER_OBSERVER_H_
+
+#include <vector>
+
+#include "ui/views/window/frame_buttons.h"
+
+namespace views {
+
+// Observer interface to receive the ordering of the min,max,close buttons.
+class WindowButtonOrderObserver {
+ public:
+ // Called when first added to the LinuxUI class, or on a system-wide
+ // configuration event.
+ virtual void OnWindowButtonOrderingChange(
+ const std::vector<views::FrameButton>& leading_buttons,
+ const std::vector<views::FrameButton>& trailing_buttons) = 0;
+
+ protected:
+ virtual ~WindowButtonOrderObserver() {}
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_LINUX_UI_WINDOW_BUTTON_ORDER_OBSERVER_H_
diff --git a/ui/views/views.gyp b/ui/views/views.gyp
index 0530055..df51058 100644
--- a/ui/views/views.gyp
+++ b/ui/views/views.gyp
@@ -317,6 +317,7 @@
'linux_ui/linux_ui.cc',
'linux_ui/status_icon_linux.h',
'linux_ui/status_icon_linux.cc',
+ 'linux_ui/window_button_order_observer.h',
'metrics.cc',
'metrics.h',
'metrics_aura.cc',
@@ -461,6 +462,7 @@
'window/dialog_delegate.h',
'window/frame_background.cc',
'window/frame_background.h',
+ 'window/frame_buttons.h',
'window/native_frame_view.cc',
'window/native_frame_view.h',
'window/non_client_view.cc',
diff --git a/ui/views/window/frame_buttons.h b/ui/views/window/frame_buttons.h
new file mode 100644
index 0000000..d534356
--- /dev/null
+++ b/ui/views/window/frame_buttons.h
@@ -0,0 +1,19 @@
+// Copyright 2013 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 UI_VIEWS_WINDOW_FRAME_BUTTONS_H_
+#define UI_VIEWS_WINDOW_FRAME_BUTTONS_H_
+
+namespace views {
+
+// Identifies what a button in a window frame is.
+enum FrameButton {
+ FRAME_BUTTON_MINIMIZE,
+ FRAME_BUTTON_MAXIMIZE,
+ FRAME_BUTTON_CLOSE
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WINDOW_FRAME_BUTTONS_H_