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

Unified Diff: ash/display/display_change_observer_chromeos.h

Issue 23286003: ash: Get output info from chromeos instead of XRandR. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use index from XRandR Created 7 years, 4 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 | « ash/ash.gyp ('k') | ash/display/display_change_observer_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_change_observer_chromeos.h
diff --git a/ash/display/display_change_observer_x11.h b/ash/display/display_change_observer_chromeos.h
similarity index 61%
rename from ash/display/display_change_observer_x11.h
rename to ash/display/display_change_observer_chromeos.h
index 33fafb34e468db6f476b0b2a28ccb4b5aee38731..546fdad428545fb5c8feceac7b02a8a2368283a6 100644
--- a/ash/display/display_change_observer_x11.h
+++ b/ash/display/display_change_observer_chromeos.h
@@ -2,13 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H
-#define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H
-
-#include <X11/Xlib.h>
-
-// Xlib.h defines RootWindow.
-#undef RootWindow
+#ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
+#define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
#include "ash/ash_export.h"
#include "ash/shell_observer.h"
@@ -18,15 +13,27 @@
namespace ash {
namespace internal {
+struct Resolution;
+
// An object that observes changes in display configuration and
// update DisplayManagers.
-class DisplayChangeObserverX11
+class DisplayChangeObserver
: public chromeos::OutputConfigurator::StateController,
public chromeos::OutputConfigurator::Observer,
public ShellObserver {
public:
- DisplayChangeObserverX11();
- virtual ~DisplayChangeObserverX11();
+ // Returns true if the size info in the output_info isn't valid
+ // and should be ignored. This is exposed for testing.
+ // |mm_width| and |mm_height| are given in millimeters.
+ ASH_EXPORT static bool ShouldIgnoreSize(unsigned long mm_width,
+ unsigned long mm_height);
+
+ // Returns the resolution list.
+ ASH_EXPORT static std::vector<Resolution> GetResolutionList(
+ const chromeos::OutputConfigurator::OutputSnapshot& output);
+
+ DisplayChangeObserver();
+ virtual ~DisplayChangeObserver();
// chromeos::OutputConfigurator::StateController overrides:
virtual chromeos::OutputState GetStateForDisplayIds(
@@ -44,16 +51,10 @@ class DisplayChangeObserverX11
virtual void OnAppTerminating() OVERRIDE;
private:
- Display* xdisplay_;
-
- ::Window x_root_window_;
-
- int xrandr_event_base_;
-
- DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11);
+ DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver);
};
} // namespace internal
} // namespace ash
-#endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_X11_H
+#endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/display_change_observer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698