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

Unified Diff: chrome/browser/dock_info_gtk.cc

Issue 119345: Use the convenience function gdk_screen_get_window_stack to enumerate top-lev... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
« no previous file with comments | « no previous file | chrome/common/gtk_util.h » ('j') | chrome/common/x11_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dock_info_gtk.cc
===================================================================
--- chrome/browser/dock_info_gtk.cc (revision 17916)
+++ chrome/browser/dock_info_gtk.cc (working copy)
@@ -12,14 +12,14 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/gtk/browser_window_gtk.h"
-#include "chrome/common/x11_util.h"
+#include "chrome/common/gtk_util.h"
////////////////////////////////////////////////////////////////////////////////
// BaseWindowFinder
//
// Base class used to locate a window. A subclass need only override
// ShouldStopIterating to determine when iteration should stop.
-class BaseWindowFinder : public x11_util::EnumerateWindowsDelegate {
+class BaseWindowFinder : public gtk_util::EnumerateWindowsDelegate {
public:
explicit BaseWindowFinder(const std::set<GtkWidget*>& ignore) {
std::set<GtkWidget*>::iterator iter;
@@ -32,9 +32,14 @@
virtual ~BaseWindowFinder() {}
protected:
+ // Returns true if |window| is in the ignore list.
+ bool ShouldIgnoreWindow(XID window) {
+ return (ignore_.find(window) != ignore_.end());
+ }
+
// Returns true if iteration should stop, false otherwise.
virtual bool ShouldStopIterating(XID window) {
- return (ignore_.find(window) != ignore_.end());
+ return false;
}
private:
@@ -61,8 +66,8 @@
protected:
virtual bool ShouldStopIterating(XID window) {
- if (BaseWindowFinder::ShouldStopIterating(window))
- return true;
+ if (BaseWindowFinder::ShouldIgnoreWindow(window))
+ return false;
if (window == target_) {
// Window is topmost, stop iterating.
@@ -95,8 +100,7 @@
target_(window),
screen_loc_(screen_loc),
is_top_most_(false) {
- XID root = x11_util::GetX11RootWindow();
- x11_util::EnumerateChildWindows(root, this);
+ gtk_util::EnumerateChildWindows(this);
}
// The window we're looking for.
@@ -134,8 +138,8 @@
protected:
virtual bool ShouldStopIterating(XID window) {
- if (BaseWindowFinder::ShouldStopIterating(window))
- return true;
+ if (BaseWindowFinder::ShouldIgnoreWindow(window))
+ return false;
// Check if this window is in our process.
if (!BrowserWindowGtk::GetBrowserWindowForXID(window))
@@ -159,8 +163,7 @@
: BaseWindowFinder(ignore),
screen_loc_(screen_loc),
result_(0) {
- XID root = x11_util::GetX11RootWindow();
- x11_util::EnumerateChildWindows(root, this);
+ gtk_util::EnumerateChildWindows(this);
}
// Position of the mouse.
« no previous file with comments | « no previous file | chrome/common/gtk_util.h » ('j') | chrome/common/x11_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698