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

Unified Diff: chrome/browser/resources/options/chromeos/display_options.js

Issue 1649173002: Add DisplayLayoutManagerMulti (WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_576375_display3e
Patch Set: Rebase Created 4 years, 11 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: chrome/browser/resources/options/chromeos/display_options.js
diff --git a/chrome/browser/resources/options/chromeos/display_options.js b/chrome/browser/resources/options/chromeos/display_options.js
index ce93d1feb8ec807d7ce57394308db4a7c977c22c..adc7708ea598f800363a15fd2c0baded90d43888 100644
--- a/chrome/browser/resources/options/chromeos/display_options.js
+++ b/chrome/browser/resources/options/chromeos/display_options.js
@@ -370,9 +370,14 @@ cr.define('options', function() {
assert(!!secondaryId);
var displayLayout =
this.displayLayoutManager_.getDisplayLayout(secondaryId);
+ console.log(
+ 'setDisplayLayout: ' + displayLayout.layoutType + ' : ' +
+ displayLayout.offset);
chrome.send(
'setDisplayLayout',
[secondaryId, displayLayout.layoutType, displayLayout.offset]);
+ // TODO(stevenjb): Remove once we send all layout changes.
+ chrome.send('getDisplayInfo');
},
/**
@@ -660,34 +665,13 @@ cr.define('options', function() {
},
/**
- * Creates a DisplayLayout object representing the display.
- * @param {!options.DisplayInfo} display
- * @param {!options.DisplayLayoutType} layoutType
- * @param {string} parentId
- * @return {!options.DisplayLayout}
- * @private
- */
- createDisplayLayout_: function(display, layoutType, parentId) {
- return {
- bounds: display.bounds,
- div: null,
- id: display.id,
- layoutType: layoutType,
- name: display.name,
- offset: 0,
- originalPosition: {x: 0, y: 0},
- parentId: parentId
- };
- },
-
- /**
* Layouts the display rectangles according to the current layout_.
* @param {options.DisplayLayoutType} layoutType
* @private
*/
layoutDisplays_: function(layoutType) {
// Create the layout manager.
- this.displayLayoutManager_ = new options.DisplayLayoutManager();
+ this.displayLayoutManager_ = new options.DisplayLayoutManagerMulti();
// Create the display layouts. Child displays are parented to the primary.
// TODO(stevenjb): DisplayInfo should provide the parent id for displays.
@@ -702,7 +686,8 @@ cr.define('options', function() {
for (var i = 0; i < this.displays_.length; i++) {
var display = this.displays_[i];
var parentId = display.isPrimary ? '' : primaryDisplayId;
- var layout = this.createDisplayLayout_(display, layoutType, parentId);
+ var layout = this.displayLayoutManager_.createDisplayLayout(
+ display.id, display.name, display.bounds, layoutType, parentId);
this.displayLayoutManager_.addDisplayLayout(layout);
}
« no previous file with comments | « chrome/browser/resources/options/chromeos/display_options.css ('k') | chrome/browser/resources/options/options_bundle.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698