OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 */ | 1948 */ |
1949 _processColor: function(text) | 1949 _processColor: function(text) |
1950 { | 1950 { |
1951 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) | 1951 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) |
1952 var color = WebInspector.Color.parse(text); | 1952 var color = WebInspector.Color.parse(text); |
1953 if (!color) | 1953 if (!color) |
1954 return createTextNode(text); | 1954 return createTextNode(text); |
1955 | 1955 |
1956 if (!this._editable()) { | 1956 if (!this._editable()) { |
1957 var swatch = WebInspector.ColorSwatch.create(); | 1957 var swatch = WebInspector.ColorSwatch.create(); |
1958 swatch.setColorText(text); | 1958 swatch.setColor(color); |
1959 return swatch; | 1959 return swatch; |
1960 } | 1960 } |
1961 | 1961 |
1962 var swatchPopoverHelper = this._parentPane._swatchPopoverHelper; | 1962 var swatchPopoverHelper = this._parentPane._swatchPopoverHelper; |
1963 var swatch = WebInspector.ColorSwatch.create(); | 1963 var swatch = WebInspector.ColorSwatch.create(); |
1964 swatch.setColorText(text); | 1964 swatch.setColor(color); |
1965 swatch.setFormat(WebInspector.Color.detectColorFormat(swatch.color())); | 1965 swatch.setFormat(WebInspector.Color.detectColorFormat(swatch.color())); |
1966 var swatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPop
overHelper, swatch); | 1966 var swatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPop
overHelper, swatch); |
1967 | 1967 |
1968 /** | 1968 /** |
1969 * @param {?Array<string>} backgroundColors | 1969 * @param {?Array<string>} backgroundColors |
1970 */ | 1970 */ |
1971 function computedCallback(backgroundColors) | 1971 function computedCallback(backgroundColors) |
1972 { | 1972 { |
1973 // TODO(aboxhall): distinguish between !backgroundColors (no text) a
nd | 1973 // TODO(aboxhall): distinguish between !backgroundColors (no text) a
nd |
1974 // !backgroundColors.length (no computed bg color) | 1974 // !backgroundColors.length (no computed bg color) |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3150 | 3150 |
3151 /** | 3151 /** |
3152 * @override | 3152 * @override |
3153 * @return {!WebInspector.ToolbarItem} | 3153 * @return {!WebInspector.ToolbarItem} |
3154 */ | 3154 */ |
3155 item: function() | 3155 item: function() |
3156 { | 3156 { |
3157 return this._button; | 3157 return this._button; |
3158 } | 3158 } |
3159 } | 3159 } |
OLD | NEW |