Commit adbae2a3 authored by finnur@chromium.org's avatar finnur@chromium.org

Polish the appearance of the Controlled by Extension bubble and change the...

Polish the appearance of the Controlled by Extension bubble and change the link from "Manage extensions" (plural) to "Manage extension" (singular). By providing the ID to the chrome://extensions page it will automatically scroll to the right extension and highlight it.

BUG=350869
R=dbeam@chromium.org

Review URL: https://codereview.chromium.org/191033002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255929 0039d316-1c4b-4281-b951-d872f2087c98
parent f49ea80f
......@@ -10416,8 +10416,8 @@ Would you like to start <ph name="CONTROL_PANEL_APPLET_NAME">$1<ex>Add/Remove Pr
<message name="IDS_OPTIONS_CONTROLLED_SETTING_EXTENSION_WITH_NAME" desc="Text displayed in the controlled settings bubble when a setting's value is enforced by an extension. The name of the extension would be displayed on the following line, thus the ending with ':'.">
This setting is controlled by:
</message>
<message name="IDS_OPTIONS_CONTROLLED_SETTING_MANAGE_EXTENSIONS" desc="Text displayed for a link to manage extensions from the controlled settings bubble.">
Manage extensions
<message name="IDS_OPTIONS_CONTROLLED_SETTING_MANAGE_EXTENSION" desc="Text displayed for a link to manage extension from the controlled settings bubble.">
Manage extension
</message>
<message name="IDS_OPTIONS_CONTROLLED_SETTING_RECOMMENDED" desc="Text displayed in the controlled settings bubble when a value is recommended for a setting through policy and the user has not overridden this recommendation.">
You are following the administrator's recommendation for this setting.
......
......@@ -56,6 +56,10 @@
padding: 0 !important;
}
.controlled-setting-bubble-header {
margin-top: 3px;
}
.controlled-setting-bubble-content-row {
height: 35px;
position: relative;
......@@ -66,7 +70,7 @@
background-repeat: no-repeat;
font-weight: bold;
height: 24px;
margin-top: -12px;
margin-top: -9px;
overflow: hidden;
padding-top: 3px;
position: absolute;
......@@ -81,7 +85,8 @@ html[dir='rtl'] .controlled-setting-bubble-extension-name {
}
.controlled-setting-bubble-extension-manage-link {
margin-top: -0.5em;
margin-left: -0.35em;
margin-top: -0.30em;
position: absolute;
top: 50%;
}
......
......@@ -142,6 +142,7 @@ cr.define('options', function() {
// Create the DOM tree.
var content = document.createElement('div');
content.classList.add('controlled-setting-bubble-header');
content.textContent = text;
if (this.controlledBy == 'hasRecommendation' && this.resetHandler_ &&
......@@ -173,13 +174,14 @@ cr.define('options', function() {
var manageLink = extensionContainer.querySelector(
'.controlled-setting-bubble-extension-manage-link');
var extensionId = this.extensionId;
manageLink.onclick = function() {
uber.invokeMethodOnWindow(
window.top, 'showPage', {pageId: 'extensions'});
window.top, 'showPage', {pageId: 'extensions',
path: '?id=' + extensionId});
};
var disableButton = extensionContainer.querySelector('button');
var extensionId = this.extensionId;
disableButton.onclick = function() {
chrome.send('disableExtension', [extensionId]);
};
......
......@@ -167,7 +167,7 @@
</div>
<div class="controlled-setting-bubble-content-row">
<div class="controlled-setting-bubble-extension-manage-link link-button"
i18n-content="controlledSettingManageExtensions"></div>
i18n-content="controlledSettingManageExtension"></div>
<button class='controlled-setting-bubble-extension-disable-button'
i18n-content="controlledSettingDisableExtension"></button>
</div>
......
......@@ -126,24 +126,27 @@ cr.define('uber', function() {
* @param {Event} e The posted object.
*/
function handleWindowMessage(e) {
if (e.data.method === 'beginInterceptingEvents')
if (e.data.method === 'beginInterceptingEvents') {
backgroundNavigation();
else if (e.data.method === 'stopInterceptingEvents')
} else if (e.data.method === 'stopInterceptingEvents') {
foregroundNavigation();
else if (e.data.method === 'setPath')
} else if (e.data.method === 'setPath') {
setPath(e.origin, e.data.params.path);
else if (e.data.method === 'setTitle')
} else if (e.data.method === 'setTitle') {
setTitle(e.origin, e.data.params.title);
else if (e.data.method === 'showPage')
showPage(e.data.params.pageId, HISTORY_STATE_OPTION.PUSH);
else if (e.data.method === 'navigationControlsLoaded')
} else if (e.data.method === 'showPage') {
showPage(e.data.params.pageId,
HISTORY_STATE_OPTION.PUSH,
e.data.params.path);
} else if (e.data.method === 'navigationControlsLoaded') {
onNavigationControlsLoaded();
else if (e.data.method === 'adjustToScroll')
} else if (e.data.method === 'adjustToScroll') {
adjustToScroll(e.data.params);
else if (e.data.method === 'mouseWheel')
} else if (e.data.method === 'mouseWheel') {
forwardMouseWheel(e.data.params);
else
} else {
console.error('Received unexpected message', e.data);
}
}
/**
......
......@@ -99,9 +99,9 @@ void CoreOptionsHandler::GetStaticLocalizedValues(
localized_strings->SetString("controlledSettingExtensionWithName",
l10n_util::GetStringUTF16(
IDS_OPTIONS_CONTROLLED_SETTING_EXTENSION_WITH_NAME));
localized_strings->SetString("controlledSettingManageExtensions",
localized_strings->SetString("controlledSettingManageExtension",
l10n_util::GetStringUTF16(
IDS_OPTIONS_CONTROLLED_SETTING_MANAGE_EXTENSIONS));
IDS_OPTIONS_CONTROLLED_SETTING_MANAGE_EXTENSION));
localized_strings->SetString("controlledSettingDisableExtension",
l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE));
localized_strings->SetString("controlledSettingRecommended",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment