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

Side by Side Diff: ui/webui/resources/js/cr/ui/bubble_button.js

Issue 543493002: Compile chrome://settings, part 2: reduce from 950 to 400 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@F_settings
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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 /** 6 /**
7 * An image button that brings up an informative bubble when activated by 7 * An image button that brings up an informative bubble when activated by
8 * keyboard or mouse. 8 * keyboard or mouse.
9 * @constructor 9 * @constructor
10 * @extends {HTMLSpanElement} 10 * @extends {HTMLSpanElement}
11 * @implements {EventListener}
11 */ 12 */
12 var BubbleButton = cr.ui.define('span'); 13 var BubbleButton = cr.ui.define('span');
13 14
14 BubbleButton.prototype = { 15 BubbleButton.prototype = {
15 __proto__: HTMLSpanElement.prototype, 16 __proto__: HTMLSpanElement.prototype,
16 17
17 /** 18 /**
18 * Decorates the base element to show the proper icon. 19 * Decorates the base element to show the proper icon.
19 */ 20 */
20 decorate: function() { 21 decorate: function() {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 case 'mousedown': 69 case 'mousedown':
69 if (document.activeElement) 70 if (document.activeElement)
70 document.activeElement.blur(); 71 document.activeElement.blur();
71 event.preventDefault(); 72 event.preventDefault();
72 return; 73 return;
73 } 74 }
74 this.toggleBubble_(); 75 this.toggleBubble_();
75 event.preventDefault(); 76 event.preventDefault();
76 event.stopPropagation(); 77 event.stopPropagation();
77 }, 78 },
79
80 /**
81 * Abstract method: subclasses should overwrite it. There is no way to mark
82 * method as abstract for Closure Compiler, as of
83 * https://github.com/google/closure-compiler/issues/104.
84 * @type {!Function|undefined}
85 * @protected
86 */
87 toggleBubble_: undefined
Dan Beam 2014/09/06 02:22:39 nit: ,
Dan Beam 2014/09/06 02:22:39 nit: maybe instead: toggleBubble: assertNotReac
Dan Beam 2014/09/06 02:22:39 @protected methods aren't suffixed with _, only @p
Vitaly Pavlenko 2014/09/06 22:54:09 Done.
Vitaly Pavlenko 2014/09/06 22:54:09 Done.
Vitaly Pavlenko 2014/09/06 22:54:09 Done.
78 }; 88 };
79 89
80 // Export. 90 // Export.
81 return { 91 return {
82 BubbleButton: BubbleButton 92 BubbleButton: BubbleButton
83 }; 93 };
84 }); 94 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698