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

Unified Diff: chromeos/display/output_configurator.h

Issue 12505005: Store rotation/ui scale to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index f65a6cc96360736332f237a064fdf6b1253e3fc2..1214f5e7259fbc334399620a1b82116d797a74d2 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -62,6 +62,14 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
virtual void OnDisplayModeChangeFailed(OutputState failed_new_state) {}
};
+ class Delegate {
+ public:
+ // Called when displays are detected first time. This is to allow
+ // chrome to select the display mode when started.
+ virtual OutputState GetStateForOutputs(
+ const std::vector<RROutput>& outputs) const = 0;
+ };
+
OutputConfigurator();
virtual ~OutputConfigurator();
@@ -69,6 +77,8 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
OutputState output_state() const { return output_state_; }
+ void set_delegate(Delegate* delegate) { 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,
@@ -172,12 +182,21 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// Updates |mirror_mode_preserved_aspect_| and |last_enter_state_time_|.
void RecordPreviousStateUMA();
+ // Returns next state.
+ OutputState GetNextState(Display* display,
+ XRRScreenResources* screen,
+ OutputState current_state,
+ const std::vector<OutputSnapshot>& outputs) const;
+
+
// Tells if the output specified by |output_info| is for internal display.
static bool IsInternalOutput(const XRROutputInfo* output_info);
// Returns output's native mode, None if not found.
static RRMode GetOutputNativeMode(const XRROutputInfo* output_info);
+ Delegate* delegate_;
+
// This is detected by the constructor to determine whether or not we should
// be enabled. If we aren't running on ChromeOS, we can't assume that the
// Xrandr X11 extension is supported.
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698