summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorprasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 17:47:41 +0000
committerprasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 17:47:41 +0000
commit4c7284c68061f41b7ddc0611dd95819ec5e4c073 (patch)
tree93fd11eb35cc2c723711926a5095cd189b59138c /ui
parent8fcd0ee58318edc4e96732ba87426f9c356abbf0 (diff)
downloadchromium_src-4c7284c68061f41b7ddc0611dd95819ec5e4c073.zip
chromium_src-4c7284c68061f41b7ddc0611dd95819ec5e4c073.tar.gz
chromium_src-4c7284c68061f41b7ddc0611dd95819ec5e4c073.tar.bz2
Have panels respond to changes in work area on Linux. This includes switching taskbar to/from auto-hide as well as changes to screen resolution.
- Factored out the part of code that listens to X property changes from ActiveWindowWatcherX into a separate class. - Implemented a watcher for work area changes. - Add hook-up for PanelManager to respond to the changes. - This change also handles user switching between auto-hide vs non auto-hide mode of taskbar. TEST=Manual. Create panels. Switch to auto-hide and see them move them move. BUG=102719 Review URL: http://codereview.chromium.org/8595003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/x/active_window_watcher_x.cc67
-rw-r--r--ui/base/x/active_window_watcher_x.h43
-rw-r--r--ui/base/x/active_window_watcher_x_observer.h26
-rw-r--r--ui/base/x/root_window_property_watcher_x.cc58
-rw-r--r--ui/base/x/root_window_property_watcher_x.h44
-rw-r--r--ui/base/x/work_area_watcher_x.cc52
-rw-r--r--ui/base/x/work_area_watcher_x.h55
-rw-r--r--ui/base/x/work_area_watcher_x_observer.h23
-rw-r--r--ui/base/x/x11_util.cc18
-rw-r--r--ui/base/x/x11_util.h3
-rw-r--r--ui/ui.gyp19
-rw-r--r--ui/views/widget/native_widget_gtk.cc3
-rw-r--r--ui/views/widget/native_widget_gtk.h6
13 files changed, 332 insertions, 85 deletions
diff --git a/ui/base/x/active_window_watcher_x.cc b/ui/base/x/active_window_watcher_x.cc
index 01c4a88..10cec2d 100644
--- a/ui/base/x/active_window_watcher_x.cc
+++ b/ui/base/x/active_window_watcher_x.cc
@@ -2,15 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <X11/Xlib.h>
+#include "ui/base/x/active_window_watcher_x.h"
+
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
-#include "ui/base/x/active_window_watcher_x.h"
+#include "ui/base/x/active_window_watcher_x_observer.h"
+#include "ui/base/x/root_window_property_watcher_x.h"
+#include "ui/base/x/x11_util.h"
namespace ui {
-static Atom g_net_active_window_atom = None;
+static const char* const kNetActiveWindow = "_NET_ACTIVE_WINDOW";
// static
ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() {
@@ -18,47 +21,41 @@ ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() {
}
// static
-void ActiveWindowWatcherX::AddObserver(Observer* observer) {
+void ActiveWindowWatcherX::AddObserver(ActiveWindowWatcherXObserver* observer) {
+ // Ensure that RootWindowPropertyWatcherX exists.
+ internal::RootWindowPropertyWatcherX::GetInstance();
GetInstance()->observers_.AddObserver(observer);
}
// static
-void ActiveWindowWatcherX::RemoveObserver(Observer* observer) {
+void ActiveWindowWatcherX::RemoveObserver(
+ ActiveWindowWatcherXObserver* observer) {
GetInstance()->observers_.RemoveObserver(observer);
}
// static
+Atom ActiveWindowWatcherX::GetPropertyAtom() {
+ return GetAtom(kNetActiveWindow);
+}
+
+// static
+void ActiveWindowWatcherX::Notify() {
+ GetInstance()->NotifyActiveWindowChanged();
+}
+
+// static
bool ActiveWindowWatcherX::WMSupportsActivation() {
return gdk_x11_screen_supports_net_wm_hint(
gdk_screen_get_default(),
- gdk_atom_intern_static_string("_NET_ACTIVE_WINDOW"));
+ gdk_atom_intern_static_string(kNetActiveWindow));
}
ActiveWindowWatcherX::ActiveWindowWatcherX() {
- Init();
}
ActiveWindowWatcherX::~ActiveWindowWatcherX() {
}
-void ActiveWindowWatcherX::Init() {
- GdkAtom net_active_window =
- gdk_atom_intern_static_string("_NET_ACTIVE_WINDOW");
- g_net_active_window_atom = gdk_x11_atom_to_xatom_for_display(
- gdk_screen_get_display(gdk_screen_get_default()), net_active_window);
-
- GdkWindow* root = gdk_get_default_root_window();
-
- // Set up X Event filter to listen for PropertyChange X events. These events
- // tell us when the active window changes.
- // Don't use XSelectInput directly here, as gdk internally seems to cache the
- // mask and reapply XSelectInput after this, resetting any mask we set here.
- gdk_window_set_events(root,
- static_cast<GdkEventMask>(gdk_window_get_events(root) |
- GDK_PROPERTY_CHANGE_MASK));
- gdk_window_add_filter(NULL, &ActiveWindowWatcherX::OnWindowXEventThunk, this);
-}
-
void ActiveWindowWatcherX::NotifyActiveWindowChanged() {
// We don't use gdk_screen_get_active_window() because it caches
// whether or not the window manager supports _NET_ACTIVE_WINDOW.
@@ -70,7 +67,7 @@ void ActiveWindowWatcherX::NotifyActiveWindowChanged() {
XGetWindowProperty(gdk_x11_get_default_xdisplay(),
GDK_WINDOW_XID(gdk_get_default_root_window()),
- g_net_active_window_atom,
+ GetAtom(kNetActiveWindow),
0, // offset into property data to read
1, // length to get in 32-bit quantities
False, // deleted
@@ -88,25 +85,11 @@ void ActiveWindowWatcherX::NotifyActiveWindowChanged() {
if (format == 32 && num_items == 1) {
int xid = *reinterpret_cast<int*>(property);
GdkWindow* active_window = gdk_window_lookup(xid);
- FOR_EACH_OBSERVER(
- Observer,
- observers_,
- ActiveWindowChanged(active_window));
+ FOR_EACH_OBSERVER(ActiveWindowWatcherXObserver, observers_,
+ ActiveWindowChanged(active_window));
}
if (property)
XFree(property);
}
-GdkFilterReturn ActiveWindowWatcherX::OnWindowXEvent(GdkXEvent* xevent,
- GdkEvent* event) {
- XEvent* xev = static_cast<XEvent*>(xevent);
-
- if (xev->xany.type == PropertyNotify &&
- xev->xproperty.atom == g_net_active_window_atom) {
- NotifyActiveWindowChanged();
- }
-
- return GDK_FILTER_CONTINUE;
-}
-
} // namespace ui
diff --git a/ui/base/x/active_window_watcher_x.h b/ui/base/x/active_window_watcher_x.h
index 4fa6b65..0358ecb 100644
--- a/ui/base/x/active_window_watcher_x.h
+++ b/ui/base/x/active_window_watcher_x.h
@@ -6,34 +6,28 @@
#define UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_
#pragma once
-#include <gdk/gdk.h>
-
#include "base/basictypes.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
-#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/ui_export.h"
+#include "ui/base/x/x11_util.h"
namespace ui {
+class ActiveWindowWatcherXObserver;
+
+namespace internal {
+class RootWindowPropertyWatcherX;
+}
+
// This is a helper class that is used to keep track of which window the X
-// window manager thinks is active. Add an Observer to listener for changes to
+// window manager thinks is active. Add an Observer to listen for changes to
// the active window.
class UI_EXPORT ActiveWindowWatcherX {
public:
- class Observer {
- public:
- // |active_window| will be NULL if the active window isn't one of Chrome's.
- virtual void ActiveWindowChanged(GdkWindow* active_window) = 0;
-
- protected:
- virtual ~Observer() {}
- };
-
static ActiveWindowWatcherX* GetInstance();
-
- static void AddObserver(Observer* observer);
- static void RemoveObserver(Observer* observer);
+ static void AddObserver(ActiveWindowWatcherXObserver* observer);
+ static void RemoveObserver(ActiveWindowWatcherXObserver* observer);
// Checks if the WM supports the active window property. Note that the return
// value can change, especially during system startup.
@@ -41,21 +35,22 @@ class UI_EXPORT ActiveWindowWatcherX {
private:
friend struct DefaultSingletonTraits<ActiveWindowWatcherX>;
+ friend class ui::internal::RootWindowPropertyWatcherX;
ActiveWindowWatcherX();
~ActiveWindowWatcherX();
- void Init();
+ // Gets the atom for the default display for the property this class is
+ // watching for.
+ static Atom GetPropertyAtom();
- // Sends a notification out through the NotificationService that the active
- // window has changed.
- void NotifyActiveWindowChanged();
+ // Notify observers that the active window has changed.
+ static void Notify();
- // Callback for PropertyChange XEvents.
- CHROMEG_CALLBACK_1(ActiveWindowWatcherX, GdkFilterReturn,
- OnWindowXEvent, GdkXEvent*, GdkEvent*);
+ // Instance method that implements Notify().
+ void NotifyActiveWindowChanged();
- ObserverList<Observer> observers_;
+ ObserverList<ActiveWindowWatcherXObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX);
};
diff --git a/ui/base/x/active_window_watcher_x_observer.h b/ui/base/x/active_window_watcher_x_observer.h
new file mode 100644
index 0000000..5369676
--- /dev/null
+++ b/ui/base/x/active_window_watcher_x_observer.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 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_BASE_X_ACTIVE_WINDOW_WATCHER_X_OBSERVER_H_
+#define UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_OBSERVER_H_
+#pragma once
+
+#include <gdk/gdk.h>
+
+#include "ui/base/ui_export.h"
+
+namespace ui {
+
+class UI_EXPORT ActiveWindowWatcherXObserver {
+ public:
+ // |active_window| will be NULL if the active window isn't one of Chrome's.
+ virtual void ActiveWindowChanged(GdkWindow* active_window) = 0;
+
+ protected:
+ virtual ~ActiveWindowWatcherXObserver() {}
+};
+
+} // namespace ui
+
+#endif // UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_OBSERVER_H_
diff --git a/ui/base/x/root_window_property_watcher_x.cc b/ui/base/x/root_window_property_watcher_x.cc
new file mode 100644
index 0000000..de8b61e
--- /dev/null
+++ b/ui/base/x/root_window_property_watcher_x.cc
@@ -0,0 +1,58 @@
+// Copyright (c) 2011 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.
+
+#include "ui/base/x/root_window_property_watcher_x.h"
+
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+
+#include "ui/base/x/active_window_watcher_x.h"
+#include "ui/base/x/work_area_watcher_x.h"
+
+namespace ui {
+
+namespace internal {
+
+// static
+RootWindowPropertyWatcherX* RootWindowPropertyWatcherX::GetInstance() {
+ return Singleton<RootWindowPropertyWatcherX>::get();
+}
+
+RootWindowPropertyWatcherX::RootWindowPropertyWatcherX() {
+ GdkWindow* root = gdk_get_default_root_window();
+
+ // Set up X Event filter to listen for PropertyChange X events.
+ // Don't use XSelectInput directly here, as gdk internally seems to cache the
+ // mask and reapply XSelectInput after this, resetting any mask we set here.
+ gdk_window_set_events(root,
+ static_cast<GdkEventMask>(gdk_window_get_events(root) |
+ GDK_PROPERTY_CHANGE_MASK));
+ gdk_window_add_filter(root,
+ &RootWindowPropertyWatcherX::OnWindowXEventThunk,
+ this);
+}
+
+RootWindowPropertyWatcherX::~RootWindowPropertyWatcherX() {
+ gdk_window_remove_filter(NULL,
+ &RootWindowPropertyWatcherX::OnWindowXEventThunk,
+ this);
+}
+
+GdkFilterReturn RootWindowPropertyWatcherX::OnWindowXEvent(
+ GdkXEvent* xevent, GdkEvent* event) {
+ XEvent* xev = static_cast<XEvent*>(xevent);
+
+ if (xev->xany.type == PropertyNotify) {
+ if (xev->xproperty.atom == ActiveWindowWatcherX::GetPropertyAtom())
+ ActiveWindowWatcherX::Notify();
+ else if (xev->xproperty.atom == WorkAreaWatcherX::GetPropertyAtom())
+ WorkAreaWatcherX::Notify();
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+} // namespace internal
+
+} // namespace ui
diff --git a/ui/base/x/root_window_property_watcher_x.h b/ui/base/x/root_window_property_watcher_x.h
new file mode 100644
index 0000000..6684e83
--- /dev/null
+++ b/ui/base/x/root_window_property_watcher_x.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_
+#define UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_
+#pragma once
+
+#include <gdk/gdk.h>
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "ui/base/gtk/gtk_signal.h"
+#include "ui/base/ui_export.h"
+
+namespace ui {
+
+namespace internal {
+
+// This class keeps track of changes to properties on the root window. This is
+// not to be used directly. Implement a watcher for the specific property you're
+// interested in.
+class RootWindowPropertyWatcherX {
+ public:
+ static RootWindowPropertyWatcherX* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<RootWindowPropertyWatcherX>;
+
+ RootWindowPropertyWatcherX();
+ ~RootWindowPropertyWatcherX();
+
+ // Callback for PropertyChange XEvents.
+ CHROMEG_CALLBACK_1(RootWindowPropertyWatcherX, GdkFilterReturn,
+ OnWindowXEvent, GdkXEvent*, GdkEvent*);
+
+ DISALLOW_COPY_AND_ASSIGN(RootWindowPropertyWatcherX);
+};
+
+} // namespace internal
+
+} // namespace ui
+
+#endif // UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_
diff --git a/ui/base/x/work_area_watcher_x.cc b/ui/base/x/work_area_watcher_x.cc
new file mode 100644
index 0000000..4fd98c9
--- /dev/null
+++ b/ui/base/x/work_area_watcher_x.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2011 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.
+
+#include "ui/base/x/work_area_watcher_x.h"
+
+#include "ui/base/x/root_window_property_watcher_x.h"
+#include "ui/base/x/work_area_watcher_x_observer.h"
+#include "ui/base/x/x11_util.h"
+
+namespace ui {
+
+static const char* const kNetWorkArea = "_NET_WORKAREA";
+
+// static
+WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() {
+ return Singleton<WorkAreaWatcherX>::get();
+}
+
+// static
+void WorkAreaWatcherX::AddObserver(WorkAreaWatcherXObserver* observer) {
+ // Ensure that RootWindowPropertyWatcherX exists.
+ internal::RootWindowPropertyWatcherX::GetInstance();
+ GetInstance()->observers_.AddObserver(observer);
+}
+
+// static
+void WorkAreaWatcherX::RemoveObserver(WorkAreaWatcherXObserver* observer) {
+ GetInstance()->observers_.RemoveObserver(observer);
+}
+
+// static
+void WorkAreaWatcherX::Notify() {
+ GetInstance()->NotifyWorkAreaChanged();
+}
+
+// static
+Atom WorkAreaWatcherX::GetPropertyAtom() {
+ return GetAtom(kNetWorkArea);
+}
+
+WorkAreaWatcherX::WorkAreaWatcherX() {
+}
+
+WorkAreaWatcherX::~WorkAreaWatcherX() {
+}
+
+void WorkAreaWatcherX::NotifyWorkAreaChanged() {
+ FOR_EACH_OBSERVER(WorkAreaWatcherXObserver, observers_, WorkAreaChanged());
+}
+
+} // namespace ui
diff --git a/ui/base/x/work_area_watcher_x.h b/ui/base/x/work_area_watcher_x.h
new file mode 100644
index 0000000..22fcb76
--- /dev/null
+++ b/ui/base/x/work_area_watcher_x.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2011 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_BASE_X_WORK_AREA_WATCHER_X_H_
+#define UI_BASE_X_WORK_AREA_WATCHER_X_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "base/observer_list.h"
+#include "ui/base/ui_export.h"
+#include "ui/base/x/x11_util.h"
+
+namespace ui {
+
+class WorkAreaWatcherXObserver;
+
+namespace internal {
+class RootWindowPropertyWatcherX;
+}
+
+// This is a helper class that is used to keep track of changes to work area.
+// Add an observer to track changes.
+class UI_EXPORT WorkAreaWatcherX {
+ public:
+ static WorkAreaWatcherX* GetInstance();
+ static void AddObserver(WorkAreaWatcherXObserver* observer);
+ static void RemoveObserver(WorkAreaWatcherXObserver* observer);
+
+ private:
+ friend struct DefaultSingletonTraits<WorkAreaWatcherX>;
+ friend class ui::internal::RootWindowPropertyWatcherX;
+
+ WorkAreaWatcherX();
+ ~WorkAreaWatcherX();
+
+ // Gets the atom for the default display for the property this class is
+ // watching for.
+ static Atom GetPropertyAtom();
+
+ // Notify observers that the work area has changed.
+ static void Notify();
+
+ // Instance method that implements Notify().
+ void NotifyWorkAreaChanged();
+
+ ObserverList<WorkAreaWatcherXObserver> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(WorkAreaWatcherX);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_X_WORK_AREA_WATCHER_X_H_
diff --git a/ui/base/x/work_area_watcher_x_observer.h b/ui/base/x/work_area_watcher_x_observer.h
new file mode 100644
index 0000000..b0c562b
--- /dev/null
+++ b/ui/base/x/work_area_watcher_x_observer.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 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_BASE_X_WORK_AREA_WATCHER_X_OBSERVER_H_
+#define UI_BASE_X_WORK_AREA_WATCHER_X_OBSERVER_H_
+#pragma once
+
+#include "ui/base/ui_export.h"
+
+namespace ui {
+
+class UI_EXPORT WorkAreaWatcherXObserver {
+ public:
+ virtual void WorkAreaChanged() = 0;
+
+ protected:
+ virtual ~WorkAreaWatcherXObserver() {}
+};
+
+} // namespace ui
+
+#endif // UI_BASE_X_WORK_AREA_WATCHER_X_OBSERVER_H_
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index aa11de8..98faee5 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -80,15 +80,6 @@ int DefaultX11IOErrorHandler(Display* d) {
_exit(1);
}
-Atom GetAtom(const char* name) {
-#if defined(TOOLKIT_USES_GTK)
- return gdk_x11_get_xatom_by_name_for_display(
- gdk_display_get_default(), name);
-#else
- return XInternAtom(GetXDisplay(), name, false);
-#endif
-}
-
// Note: The caller should free the resulting value data.
bool GetProperty(XID window, const std::string& property_name, long max_length,
Atom* type, int* format, unsigned long* num_items,
@@ -429,6 +420,15 @@ bool GetStringProperty(
return true;
}
+Atom GetAtom(const char* name) {
+#if defined(TOOLKIT_USES_GTK)
+ return gdk_x11_get_xatom_by_name_for_display(
+ gdk_display_get_default(), name);
+#else
+ return XInternAtom(GetXDisplay(), name, false);
+#endif
+}
+
XID GetParentWindow(XID window) {
XID root = None;
XID parent = None;
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index 888e76a..4f2fe33 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -123,6 +123,9 @@ UI_EXPORT bool GetAtomArrayProperty(XID window,
UI_EXPORT bool GetStringProperty(
XID window, const std::string& property_name, std::string* value);
+// Gets the X atom for default display corresponding to atom_name.
+Atom GetAtom(const char* atom_name);
+
// Get |window|'s parent window, or None if |window| is the root window.
XID GetParentWindow(XID window);
diff --git a/ui/ui.gyp b/ui/ui.gyp
index d173b95..347ba80 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -225,7 +225,13 @@
'base/win/window_impl.h',
'base/x/active_window_watcher_x.cc',
'base/x/active_window_watcher_x.h',
+ 'base/x/active_window_watcher_x_observer.h',
'base/x/events_x.cc',
+ 'base/x/root_window_property_watcher_x.cc',
+ 'base/x/root_window_property_watcher_x.h',
+ 'base/x/work_area_watcher_x.cc',
+ 'base/x/work_area_watcher_x.h',
+ 'base/x/work_area_watcher_x_observer.h',
'base/x/x11_util.cc',
'base/x/x11_util.h',
'base/x/x11_util_internal.h',
@@ -346,6 +352,12 @@
['exclude', 'base/win/mouse_wheel_util.h'],
['exclude', 'base/x/active_window_watcher_x.cc'],
['exclude', 'base/x/active_window_watcher_x.h'],
+ ['exclude', 'base/x/active_window_watcher_x_observer.h'],
+ ['exclude', 'base/x/root_window_property_watcher_x.cc'],
+ ['exclude', 'base/x/root_window_property_watcher_x.h'],
+ ['exclude', 'base/x/work_area_watcher_x.cc'],
+ ['exclude', 'base/x/work_area_watcher_x.h'],
+ ['exclude', 'base/x/work_area_watcher_x_observer.h'],
],
}, { # use_aura!=1
'sources!': [
@@ -542,12 +554,7 @@
'sources!': [
'base/keycodes/keyboard_code_conversion_x.cc',
'base/keycodes/keyboard_code_conversion_x.h',
- 'base/x/active_window_watcher_x.cc',
- 'base/x/active_window_watcher_x.h',
- 'base/x/events_x.cc',
- 'base/x/x11_util.cc',
- 'base/x/x11_util.h',
- 'base/x/x11_util_internal.h',
+ 'base/x/',
],
}],
['chromeos==1', {
diff --git a/ui/views/widget/native_widget_gtk.cc b/ui/views/widget/native_widget_gtk.cc
index 2d6556f..4e60e70 100644
--- a/ui/views/widget/native_widget_gtk.cc
+++ b/ui/views/widget/native_widget_gtk.cc
@@ -26,6 +26,7 @@
#include "ui/base/gtk/gtk_windowing.h"
#include "ui/base/gtk/scoped_handle_gtk.h"
#include "ui/base/hit_test.h"
+#include "ui/base/x/active_window_watcher_x.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/canvas_skia_paint.h"
#include "ui/gfx/compositor/compositor.h"
@@ -560,7 +561,7 @@ void NativeWidgetGtk::GetRequestedSize(gfx::Size* out) const {
}
////////////////////////////////////////////////////////////////////////////////
-// NativeWidgetGtk, ActiveWindowWatcherX::Observer implementation:
+// NativeWidgetGtk, ActiveWindowWatcherXObserver implementation:
void NativeWidgetGtk::ActiveWindowChanged(GdkWindow* active_window) {
if (!GetNativeView())
diff --git a/ui/views/widget/native_widget_gtk.h b/ui/views/widget/native_widget_gtk.h
index 327edb3..373eccb 100644
--- a/ui/views/widget/native_widget_gtk.h
+++ b/ui/views/widget/native_widget_gtk.h
@@ -12,7 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/x/active_window_watcher_x.h"
+#include "ui/base/x/active_window_watcher_x_observer.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/size.h"
#include "ui/views/focus/focus_manager.h"
@@ -44,7 +44,7 @@ class NativeWidgetDelegate;
// Widget implementation for GTK.
class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate,
public ui::CompositorDelegate,
- public ui::ActiveWindowWatcherX::Observer {
+ public ui::ActiveWindowWatcherXObserver {
public:
explicit NativeWidgetGtk(internal::NativeWidgetDelegate* delegate);
virtual ~NativeWidgetGtk();
@@ -104,7 +104,7 @@ class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate,
// size of other kinds of widgets.
void GetRequestedSize(gfx::Size* out) const;
- // Overridden from ui::ActiveWindowWatcherX::Observer.
+ // Overridden from ui::ActiveWindowWatcherXObserver.
virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
// Handles a keyboard event by sending it to our focus manager.