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

Unified Diff: chrome/browser/screensaver_window_finder_linux.cc

Issue 7945014: Applied review comments from oshima for CL 7850026. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 3 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 | « chrome/browser/screensaver_window_finder_linux.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/screensaver_window_finder_linux.cc
diff --git a/chrome/browser/screensaver_window_finder_linux.cc b/chrome/browser/screensaver_window_finder_linux.cc
deleted file mode 100644
index e43b2d85e2513e51dc57447af1361ac64ecb8720..0000000000000000000000000000000000000000
--- a/chrome/browser/screensaver_window_finder_linux.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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 "chrome/browser/screensaver_window_finder_linux.h"
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-
-#include "base/basictypes.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
-#include "ui/base/x/x11_util.h"
-
-
-ScreensaverWindowFinder::ScreensaverWindowFinder()
- : exists_(false) {
-}
-
-bool ScreensaverWindowFinder::ScreensaverWindowExists() {
-#if defined(USE_AURA)
- return false;
-#else
- gdk_error_trap_push();
- ScreensaverWindowFinder finder;
- gtk_util::EnumerateTopLevelWindows(&finder);
- bool got_error = gdk_error_trap_pop();
- return finder.exists_ && !got_error;
-#endif
-}
-
-bool ScreensaverWindowFinder::ShouldStopIterating(XID window) {
- if (!ui::IsWindowVisible(window) || !IsScreensaverWindow(window))
- return false;
- exists_ = true;
- return true;
-}
-
-bool ScreensaverWindowFinder::IsScreensaverWindow(XID window) const {
- // It should occupy the full screen.
- if (!ui::IsX11WindowFullScreen(window))
- return false;
-
- // For xscreensaver, the window should have _SCREENSAVER_VERSION property.
- if (ui::PropertyExists(window, "_SCREENSAVER_VERSION"))
- return true;
-
- // For all others, like gnome-screensaver, the window's WM_CLASS property
- // should contain "screensaver".
- std::string value;
- if (!ui::GetStringProperty(window, "WM_CLASS", &value))
- return false;
-
- return value.find("screensaver") != std::string::npos;
-}
« no previous file with comments | « chrome/browser/screensaver_window_finder_linux.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698