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

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

Issue 1300703004: DevTools: only set title w/ shortcut via Tooltip manager API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 5 years, 4 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
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/ui/FilterBar.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {HTMLSpanElement} 7 * @extends {HTMLSpanElement}
8 */ 8 */
9 WebInspector.ColorSwatch = function() 9 WebInspector.ColorSwatch = function()
10 { 10 {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 { 75 {
76 return this._iconElement; 76 return this._iconElement;
77 }, 77 },
78 78
79 createdCallback: function() 79 createdCallback: function()
80 { 80 {
81 var root = WebInspector.createShadowRootWithCoreStyles(this); 81 var root = WebInspector.createShadowRootWithCoreStyles(this);
82 root.appendChild(WebInspector.Widget.createStyleElement("ui/colorSwatch. css")); 82 root.appendChild(WebInspector.Widget.createStyleElement("ui/colorSwatch. css"));
83 83
84 this._iconElement = root.createChild("span", "color-swatch"); 84 this._iconElement = root.createChild("span", "color-swatch");
85 WebInspector.Tooltip.install(this._iconElement, WebInspector.UIString("S hift-click to change color format")); 85 this._iconElement.title = WebInspector.UIString("Shift-click to change c olor format");
86 this._swatchInner = this._iconElement.createChild("span", "color-swatch- inner"); 86 this._swatchInner = this._iconElement.createChild("span", "color-swatch- inner");
87 this._swatchInner.addEventListener("dblclick", consumeEvent, false); 87 this._swatchInner.addEventListener("dblclick", consumeEvent, false);
88 this._swatchInner.addEventListener("mousedown", consumeEvent, false); 88 this._swatchInner.addEventListener("mousedown", consumeEvent, false);
89 this._swatchInner.addEventListener("click", this._handleClick.bind(this) , true); 89 this._swatchInner.addEventListener("click", this._handleClick.bind(this) , true);
90 90
91 root.createChild("content"); 91 root.createChild("content");
92 this._colorValueElement = this.createChild("span"); 92 this._colorValueElement = this.createChild("span");
93 93
94 this.setColorText("white"); 94 this.setColorText("white");
95 }, 95 },
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 case cf.Nickname: 150 case cf.Nickname:
151 if (!color.hasAlpha()) 151 if (!color.hasAlpha())
152 return color.canBeShortHex() ? cf.ShortHEX : cf.HEX; 152 return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
153 else 153 else
154 return cf.Original; 154 return cf.Original;
155 155
156 default: 156 default:
157 return cf.RGBA; 157 return cf.RGBA;
158 } 158 }
159 } 159 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/ui/FilterBar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698