} items The items expected to show in the menu.
*/
function assertMenu(items) {
- const menu = testElement.$$('dialog[is=cr-action-menu]');
+ const menu = testElement.$$('cr-action-menu');
assertTrue(!!menu);
const menuItems = menu.querySelectorAll('button:not([hidden])');
assertEquals(items.length, menuItems.length);
@@ -422,7 +422,7 @@ suite('SiteList', function() {
setUpCategory(
settings.ContentSettingsTypes.GEOLOCATION,
settings.ContentSetting.ALLOW, prefsGeolocation);
- const actionMenu = testElement.$$('dialog[is=cr-action-menu]');
+ const actionMenu = testElement.$$('cr-action-menu');
return browserProxy.whenCalled('getExceptionList')
.then(function(contentType) {
Polymer.dom.flush(); // Populates action menu.
@@ -669,7 +669,7 @@ suite('SiteList', function() {
openActionMenu(0);
assertMenu(['Allow', 'Block', 'Edit', 'Remove'], testElement);
- const menu = testElement.$$('dialog[is=cr-action-menu]');
+ const menu = testElement.$$('cr-action-menu');
assertTrue(menu.open);
const edit = testElement.$.edit;
assertTrue(!!edit);
diff --git a/chrome/test/data/webui/settings/startup_urls_page_test.js b/chrome/test/data/webui/settings/startup_urls_page_test.js
index 5374576a865c03..73b6765f73cf2d 100644
--- a/chrome/test/data/webui/settings/startup_urls_page_test.js
+++ b/chrome/test/data/webui/settings/startup_urls_page_test.js
@@ -335,10 +335,10 @@ cr.define('settings_startup_urls_page', function() {
Polymer.dom.flush();
// Bring up the popup menu.
- assertFalse(!!element.$$('dialog[is=cr-action-menu]'));
+ assertFalse(!!element.$$('cr-action-menu'));
MockInteractions.tap(element.$$('#dots'));
Polymer.dom.flush();
- assertTrue(!!element.$$('dialog[is=cr-action-menu]'));
+ assertTrue(!!element.$$('cr-action-menu'));
const removeButton = element.shadowRoot.querySelector('#remove');
MockInteractions.tap(removeButton);
diff --git a/chrome/test/data/webui/settings/usb_devices_tests.js b/chrome/test/data/webui/settings/usb_devices_tests.js
index e1236cfa366b93..4345c8cb97a7dc 100644
--- a/chrome/test/data/webui/settings/usb_devices_tests.js
+++ b/chrome/test/data/webui/settings/usb_devices_tests.js
@@ -94,7 +94,7 @@ suite('UsbDevices', function() {
testElement.$$('paper-icon-button-light.icon-more-vert');
assertTrue(!!menuButton);
MockInteractions.tap(menuButton.querySelector('button'));
- const dialog = testElement.$$('dialog[is=cr-action-menu]');
+ const dialog = testElement.$$('cr-action-menu');
assertTrue(dialog.open);
});
});
@@ -123,7 +123,7 @@ suite('UsbDevices', function() {
assertEquals(deviceList[indexToRemove].embeddingOrigin, args[1]);
assertEquals(deviceList[indexToRemove].object, args[2]);
- const dialog = testElement.$$('dialog[is=cr-action-menu]');
+ const dialog = testElement.$$('cr-action-menu');
assertFalse(dialog.open);
});
}
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.html b/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.html
index f57fd4e3134eb7..4666209156d369 100644
--- a/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.html
+++ b/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.html
@@ -37,7 +37,7 @@
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.js b/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.js
index f2bc22e51fcb6e..8467bd7c15fa19 100644
--- a/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.js
+++ b/ui/webui/resources/cr_components/certificate_manager/certificate_subentry.js
@@ -139,7 +139,7 @@ Polymer({
/** @private */
closePopupMenu_: function() {
- this.$$('dialog[is=cr-action-menu]').close();
+ this.$$('cr-action-menu').close();
},
/** @private */
diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html
index 70acc097ff29ab..ef6cca6b2f36d3 100644
--- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html
+++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html
@@ -8,16 +8,18 @@
diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
index 31613726bccb34..3da580b9cb583f 100644
--- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
+++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
@@ -117,7 +117,6 @@ function getDefaultShowConfig() {
Polymer({
is: 'cr-action-menu',
- extends: 'dialog',
/**
* The element which the action menu will be anchored to. Also the element
@@ -157,6 +156,11 @@ Polymer({
type: Boolean,
value: false,
},
+
+ open: {
+ type: Boolean,
+ value: false,
+ },
},
listeners: {
@@ -170,6 +174,14 @@ Polymer({
this.removeListeners_();
},
+ /**
+ * Exposing internal