Commit 70ca3dd8 authored by Yann Dago's avatar Yann Dago Committed by Commit Bot

Open management page from managed ui footnote

Bug: 933517
Change-Id: I25a5de9d70545623bce187fe21843fbb185b9009
Reviewed-on: https://chromium-review.googlesource.com/c/1478109
Commit-Queue: Yann Dago <ydago@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635791}
parent f0a09598
......@@ -178,7 +178,7 @@
#define IDC_SHOW_BETA_FORUM 40252
#define IDC_TOGGLE_JAVASCRIPT_APPLE_EVENTS 40253
#define IDC_INSTALL_PWA 40254
#define IDC_MANAGED_UI_HELP 40255
#define IDC_SHOW_MANAGEMENT_PAGE 40255
#define IDC_PASTE_AND_GO 40256
// Spell-check
......
......@@ -686,8 +686,8 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_WINDOW_PIN_TAB:
PinTab(browser_);
break;
case IDC_MANAGED_UI_HELP:
ShowSingletonTab(browser_, GURL(kManagedUiLearnMoreUrl));
case IDC_SHOW_MANAGEMENT_PAGE:
ShowSingletonTab(browser_, GURL(kChromeUIManagementURL));
break;
// Hosted App commands
......@@ -1207,7 +1207,7 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode() {
command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_MANAGED_UI_HELP, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_MANAGEMENT_PAGE, true);
if (base::debug::IsProfilingSupported())
command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
......
......@@ -833,7 +833,7 @@ void AppMenuModel::Build() {
ui::NativeTheme::kColorId_HighlightedMenuItemForegroundColor);
const auto icon =
gfx::CreateVectorIcon(vector_icons::kBusinessIcon, kIconSize, color);
AddHighlightedItemWithStringIdAndIcon(IDC_MANAGED_UI_HELP,
AddHighlightedItemWithStringIdAndIcon(IDC_SHOW_MANAGEMENT_PAGE,
IDS_MANAGED_BY_ORG, icon);
}
#endif // !defined(OS_CHROMEOS)
......
......@@ -15,7 +15,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/managed_ui.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
......@@ -122,7 +122,7 @@ std::unique_ptr<base::DictionaryValue> ManagedUIHandler::GetDataSourceUpdate()
update->SetKey("managedByOrg",
base::Value(l10n_util::GetStringFUTF16(
IDS_MANAGED_BY_ORG_WITH_HYPERLINK,
base::UTF8ToUTF16(chrome::kManagedUiLearnMoreUrl)
base::UTF8ToUTF16(chrome::kChromeUIManagementURL)
#if defined(OS_CHROMEOS)
,
ui::GetChromeOSDeviceName()
......
......@@ -153,10 +153,6 @@ const char kLegacySupervisedUserManagementDisplayURL[] =
const char kLegacySupervisedUserManagementURL[] =
"https://www.chrome.com/manage";
// TODO(nicolaso): Replace with a p-link once it's ready. b/117655761
const char kManagedUiLearnMoreUrl[] =
"https://support.google.com/chromebook/answer/1331549";
const char kMyActivityUrlInClearBrowsingData[] =
"https://myactivity.google.com/myactivity/?utm_source=chrome_cbd";
......
......@@ -145,9 +145,6 @@ extern const char kLegacySupervisedUserManagementDisplayURL[];
// Management URL for Chrome Supervised Users.
extern const char kLegacySupervisedUserManagementURL[];
// The URL for the Learn More page about policies and enterprise enrollment.
extern const char kManagedUiLearnMoreUrl[];
// "myactivity.google.com" URL for the history checkbox in ClearBrowsingData.
extern const char kMyActivityUrlInClearBrowsingData[];
......
......@@ -19,8 +19,9 @@ suite('managed-footnote', function() {
* substitution.
* @return {HTMLElement}
*/
function setupTestElement(isManaged, message) {
function setupTestElement(isManaged, message, managementPageUrl) {
loadTimeData.overrideValues({
chromeManagementUrl: managementPageUrl,
isManaged: isManaged,
managedByOrg: message,
});
......@@ -31,19 +32,19 @@ suite('managed-footnote', function() {
}
test('Hidden When isManaged Is False', function() {
const footnote = setupTestElement(false, '');
const footnote = setupTestElement(false, '', '');
assertEquals('none', getComputedStyle(footnote).display);
});
test('Reads Attributes From loadTimeData', function() {
const message = 'the quick brown fox jumps over the lazy dog';
const footnote = setupTestElement(true, message);
const footnote = setupTestElement(true, message, '');
assertNotEquals('none', getComputedStyle(footnote).display);
assertTrue(footnote.shadowRoot.textContent.includes(message));
});
test('Responds to is-managed-changed events', function() {
const footnote = setupTestElement(false, '');
const footnote = setupTestElement(false, '', '');
assertEquals('none', getComputedStyle(footnote).display);
cr.webUIListenerCallback('is-managed-changed', [true]);
......
......@@ -12,7 +12,6 @@
*/
(function() {
Polymer({
is: 'managed-footnote',
......
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