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

Side by Side Diff: Source/devtools/front_end/ui/StatusBarButton.js

Issue 663083004: [DevTools] Remove remaining usages of global properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 }, 391 },
392 392
393 _showOptions: function() 393 _showOptions: function()
394 { 394 {
395 var buttons = this._longClickOptionsData.buttonsProvider(); 395 var buttons = this._longClickOptionsData.buttonsProvider();
396 var mainButtonClone = new WebInspector.StatusBarButton(this.title, this. className, this.states); 396 var mainButtonClone = new WebInspector.StatusBarButton(this.title, this. className, this.states);
397 mainButtonClone.addEventListener("click", this._clicked, this); 397 mainButtonClone.addEventListener("click", this._clicked, this);
398 mainButtonClone.state = this.state; 398 mainButtonClone.state = this.state;
399 buttons.push(mainButtonClone); 399 buttons.push(mainButtonClone);
400 400
401 var document = this.element.ownerDocument;
401 document.documentElement.addEventListener("mouseup", mouseUp, false); 402 document.documentElement.addEventListener("mouseup", mouseUp, false);
402 403
403 var optionsGlassPane = new WebInspector.GlassPane(); 404 var optionsGlassPane = new WebInspector.GlassPane(document);
404 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt ernate-status-bar-buttons-bar"); 405 var optionsBarElement = optionsGlassPane.element.createChild("div", "alt ernate-status-bar-buttons-bar");
405 const buttonHeight = 23; 406 const buttonHeight = 23;
406 407
407 var hostButtonPosition = this.element.totalOffset(); 408 var hostButtonPosition = this.element.totalOffset();
408 409
409 var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.lengt h < document.documentElement.offsetHeight; 410 var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.lengt h < document.documentElement.offsetHeight;
410 411
411 if (topNotBottom) 412 if (topNotBottom)
412 buttons = buttons.reverse(); 413 buttons = buttons.reverse();
413 414
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 var options = []; 747 var options = [];
747 for (var index = 0; index < this._states.length; index++) { 748 for (var index = 0; index < this._states.length; index++) {
748 if (this._states[index] !== this.state && this._states[index] !== th is._currentState) 749 if (this._states[index] !== this.state && this._states[index] !== th is._currentState)
749 options.push(this._buttons[index]); 750 options.push(this._buttons[index]);
750 } 751 }
751 return options; 752 return options;
752 }, 753 },
753 754
754 __proto__: WebInspector.StatusBarButton.prototype 755 __proto__: WebInspector.StatusBarButton.prototype
755 } 756 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/SoftContextMenu.js ('k') | Source/devtools/front_end/ui/SuggestBox.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698