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

Unified Diff: chromeos/display/output_configurator.h

Issue 13756002: chromeos: Add testing support code to OutputConfigurator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove delegate check Created 7 years, 8 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 | chromeos/display/output_configurator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index c59c0765bdff9d5a0b0b7ff7667d54cc2b5609d8..bac694a5e13588ec1a1bf226ec433ae24abd1728 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -177,6 +177,31 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// size for the corresponding offset.
virtual void ConfigureCTM(int touch_device_id,
const CoordinateTransformation& ctm) = 0;
+
+ // Sends a D-Bus message to the power manager telling it that the
+ // machine is or is not projecting.
+ virtual void SendProjectingStateToPowerManager(bool projecting) = 0;
+ };
+
+ // Helper class used by tests.
+ class TestApi {
+ public:
+ TestApi(OutputConfigurator* configurator, int xrandr_event_base)
+ : configurator_(configurator),
+ xrandr_event_base_(xrandr_event_base) {}
+ ~TestApi() {}
+
+ // Dispatches RRScreenChangeNotify and RRNotify_OutputChange events to
+ // |configurator_| and runs ConfigureOutputs(). Returns false if
+ // |configure_timer_| wasn't started.
+ bool SendOutputChangeEvents(bool connected);
+
+ private:
+ OutputConfigurator* configurator_; // not owned
+
+ int xrandr_event_base_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestApi);
};
// Flags that can be passed to SetDisplayPower().
@@ -187,6 +212,15 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// only connected display is external.
static const int kSetDisplayPowerOnlyIfSingleInternalDisplay = 1 << 1;
+ // Gap between screens so cursor at bottom of active display doesn't
+ // partially appear on top of inactive display. Higher numbers guard
+ // against larger cursors, but also waste more memory.
+ // For simplicity, this is hard-coded to avoid the complexity of always
+ // determining the DPI of the screen and rationalizing which screen we
+ // need to use for the DPI calculation.
+ // See crbug.com/130188 for initial discussion.
+ static const int kVerticalGap = 60;
+
// Returns true if an output named |name| is an internal display.
static bool IsInternalOutputName(const std::string& name);
@@ -206,6 +240,10 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
state_controller_ = controller;
}
+ // Replaces |delegate_| with |delegate| and sets |configure_display_| to
+ // true. Should be called before Init().
+ void SetDelegateForTesting(scoped_ptr<Delegate> delegate);
+
// Initialization, must be called right after constructor.
// |is_panel_fitting_enabled| indicates hardware panel fitting support.
// If |background_color_argb| is non zero and there are multiple displays,
« no previous file with comments | « no previous file | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698