diff options
author | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 17:18:17 +0000 |
---|---|---|
committer | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 17:18:17 +0000 |
commit | a21ea79c953c0cd935161a6946502a54eefe57da (patch) | |
tree | 6e1f5d4c10bde261f121553751f2a3790c25acbb /chrome/browser/resources/shared/js/cr/ui/bubble_button.js | |
parent | 12a1bbda1933c59924aa44937e0c9aff84b647f9 (diff) | |
download | chromium_src-a21ea79c953c0cd935161a6946502a54eefe57da.zip chromium_src-a21ea79c953c0cd935161a6946502a54eefe57da.tar.gz chromium_src-a21ea79c953c0cd935161a6946502a54eefe57da.tar.bz2 |
Revert 176910 - Possible breakage of PlatformAppBrowserTest.Messaging
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%28dbg%29%282%29/builds/25744/steps/browser_tests/logs/Messaging
> Add base class cr.ui.BubbleButton for options.ControlledSettingIndicator
>
> This CL extracts a cr.ui.BubbleButton base class from the
> options.ControlledSettingIndicator so that it can be shared with the
> upcoming improved about:policy page.
>
> BUG=134849
> TEST=Manual
>
>
> Review URL: https://chromiumcodereview.appspot.com/11864019
TBR=bartfab@chromium.org
Review URL: https://codereview.chromium.org/11882045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/shared/js/cr/ui/bubble_button.js')
-rw-r--r-- | chrome/browser/resources/shared/js/cr/ui/bubble_button.js | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/chrome/browser/resources/shared/js/cr/ui/bubble_button.js b/chrome/browser/resources/shared/js/cr/ui/bubble_button.js deleted file mode 100644 index 7216a2d..0000000 --- a/chrome/browser/resources/shared/js/cr/ui/bubble_button.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -cr.define('cr.ui', function() { - /** - * An image button that brings up an informative bubble when activated by - * keyboard or mouse. - * @constructor - * @extends {HTMLSpanElement} - */ - var BubbleButton = cr.ui.define('span'); - - BubbleButton.prototype = { - __proto__: HTMLSpanElement.prototype, - - /** - * Decorates the base element to show the proper icon. - */ - decorate: function() { - this.className = 'bubble-button'; - this.location = cr.ui.ArrowLocation.TOP_END; - this.image = document.createElement('div'); - this.image.tabIndex = 0; - this.image.setAttribute('role', 'button'); - this.image.addEventListener('click', this); - this.image.addEventListener('keydown', this); - this.image.addEventListener('mousedown', this); - this.appendChild(this.image); - }, - - /** - * Whether the button is currently showing a bubble. - * @type {boolean} - */ - get showingBubble() { - return this.image.classList.contains('showing-bubble'); - }, - set showingBubble(showing) { - this.image.classList.toggle('showing-bubble', showing); - }, - - /** - * Handle mouse and keyboard events, allowing the user to open and close an - * informative bubble. - * @param {Event} event Mouse or keyboard event. - */ - handleEvent: function(event) { - switch (event.type) { - // Toggle the bubble on left click. Let any other clicks propagate. - case 'click': - if (event.button != 0) - return; - break; - // Toggle the bubble when <Return> or <Space> is pressed. Let any other - // key presses propagate. - case 'keydown': - switch (event.keyCode) { - case 13: // Return. - case 32: // Space. - break; - default: - return; - } - break; - // Blur focus when a mouse button is pressed, matching the behavior of - // other Web UI elements. - case 'mousedown': - if (document.activeElement) - document.activeElement.blur(); - event.preventDefault(); - return; - } - this.toggleBubble_(); - event.preventDefault(); - event.stopPropagation(); - }, - }; - - // Export. - return { - BubbleButton: BubbleButton - }; -}); |