| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 __proto__: WebInspector.NavigatorView.prototype | 202 __proto__: WebInspector.NavigatorView.prototype |
| 203 } | 203 } |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * @constructor | 206 * @constructor |
| 207 * @extends {WebInspector.NavigatorView} | 207 * @extends {WebInspector.NavigatorView} |
| 208 */ | 208 */ |
| 209 WebInspector.SnippetsNavigatorView = function() | 209 WebInspector.SnippetsNavigatorView = function() |
| 210 { | 210 { |
| 211 WebInspector.NavigatorView.call(this); | 211 WebInspector.NavigatorView.call(this); |
| 212 var toolbar = new WebInspector.Toolbar("snippets-navigator-toolbar"); |
| 213 var newButton = new WebInspector.ToolbarButton(WebInspector.UIString("New"),
"add-toolbar-item"); |
| 214 newButton.addEventListener("click", this._handleCreateSnippet.bind(this)); |
| 215 toolbar.appendToolbarItem(newButton); |
| 216 this.element.insertBefore(toolbar.element, this.element.firstChild); |
| 212 } | 217 } |
| 213 | 218 |
| 214 WebInspector.SnippetsNavigatorView.prototype = { | 219 WebInspector.SnippetsNavigatorView.prototype = { |
| 215 /** | 220 /** |
| 216 * @override | 221 * @override |
| 217 * @param {!WebInspector.UISourceCode} uiSourceCode | 222 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 218 * @return {boolean} | 223 * @return {boolean} |
| 219 */ | 224 */ |
| 220 accept: function(uiSourceCode) | 225 accept: function(uiSourceCode) |
| 221 { | 226 { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 /** | 295 /** |
| 291 * @override | 296 * @override |
| 292 */ | 297 */ |
| 293 sourceDeleted: function(uiSourceCode) | 298 sourceDeleted: function(uiSourceCode) |
| 294 { | 299 { |
| 295 this._handleRemoveSnippet(uiSourceCode); | 300 this._handleRemoveSnippet(uiSourceCode); |
| 296 }, | 301 }, |
| 297 | 302 |
| 298 __proto__: WebInspector.NavigatorView.prototype | 303 __proto__: WebInspector.NavigatorView.prototype |
| 299 } | 304 } |
| OLD | NEW |