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

Side by Side Diff: chrome/browser/resources/options/chromeos/display_options.js

Issue 570503002: Compile chrome://settings, part 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_4
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.exportPath('options'); 5 cr.exportPath('options');
6 6
7 /** 7 /**
8 * @typedef {{ 8 * @typedef {{
9 * availableColorProfiles: Array.<{profileId: number, name: string}>, 9 * availableColorProfiles: Array.<{profileId: number, name: string}>,
10 * colorProfile: number, 10 * colorProfile: number,
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 * @param {Event} e The mouse down event. 266 * @param {Event} e The mouse down event.
267 * @private 267 * @private
268 */ 268 */
269 onMouseDown_: function(e) { 269 onMouseDown_: function(e) {
270 if (this.mirroring_) 270 if (this.mirroring_)
271 return true; 271 return true;
272 272
273 if (e.button != 0) 273 if (e.button != 0)
274 return true; 274 return true;
275 275
276 e.preventDefault(); 276 e.preventDefault();
Dan Beam 2014/09/12 03:25:19 var target = assertInstanceof(e.target, HTMLElemen
Vitaly Pavlenko 2014/09/12 19:16:22 Done.
277 return this.startDragging_(e.target, {x: e.pageX, y: e.pageY}); 277 return this.startDragging_(assertInstanceof(e.target, HTMLElement),
278 {x: e.pageX, y: e.pageY});
278 }, 279 },
279 280
280 /** 281 /**
281 * Touch start handler for dragging display rectangle. 282 * Touch start handler for dragging display rectangle.
282 * @param {Event} e The touch start event. 283 * @param {Event} e The touch start event.
283 * @private 284 * @private
284 */ 285 */
285 onTouchStart_: function(e) { 286 onTouchStart_: function(e) {
286 if (this.mirroring_) 287 if (this.mirroring_)
287 return true; 288 return true;
288 289
289 if (e.touches.length != 1) 290 if (e.touches.length != 1)
290 return false; 291 return false;
291 292
292 e.preventDefault(); 293 e.preventDefault();
293 var touch = e.touches[0]; 294 var touch = e.touches[0];
294 this.lastTouchLocation_ = {x: touch.pageX, y: touch.pageY}; 295 this.lastTouchLocation_ = {x: touch.pageX, y: touch.pageY};
Dan Beam 2014/09/12 03:25:19 var target = assertInstanceof(e.target, HTMLElemen
Vitaly Pavlenko 2014/09/12 19:16:22 Done.
295 return this.startDragging_(e.target, this.lastTouchLocation_); 296 return this.startDragging_(assertInstanceof(e.target, HTMLElement),
297 this.lastTouchLocation_);
296 }, 298 },
297 299
298 /** 300 /**
299 * Collects the current data and sends it to Chrome. 301 * Collects the current data and sends it to Chrome.
300 * @private 302 * @private
301 */ 303 */
302 applyResult_: function() { 304 applyResult_: function() {
303 // Offset is calculated from top or left edge. 305 // Offset is calculated from top or left edge.
304 var primary = this.primaryDisplay_; 306 var primary = this.primaryDisplay_;
305 var secondary = this.secondaryDisplay_; 307 var secondary = this.secondaryDisplay_;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 mirroring, displays, layout, offset) { 908 mirroring, displays, layout, offset) {
907 DisplayOptions.getInstance().onDisplayChanged_( 909 DisplayOptions.getInstance().onDisplayChanged_(
908 mirroring, displays, layout, offset); 910 mirroring, displays, layout, offset);
909 }; 911 };
910 912
911 // Export 913 // Export
912 return { 914 return {
913 DisplayOptions: DisplayOptions 915 DisplayOptions: DisplayOptions
914 }; 916 };
915 }); 917 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698