Skip to content

Commit

Permalink
[Settings WebUI] Only show "Manage other people" on CrOS
Browse files Browse the repository at this point in the history
This change modifies the people section to only show the "Manage other
people" row on Chrome OS. On other platforms this option will still be
accessible from the Profile Chooser.

Bug: 907035
Change-Id: I7c2ab9ee97658e37a11f9d9a6d9ac0736ed2a1d2
Reviewed-on: https://chromium-review.googlesource.com/c/1349336
Reviewed-by: Demetrios Papadopoulos <[email protected]>
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#613258}(cherry picked from commit c36d09a)
Reviewed-on: https://chromium-review.googlesource.com/c/1362497
Reviewed-by: Jan Wilken Dörrie <[email protected]>
Cr-Commit-Position: refs/branch-heads/3626@{#61}
Cr-Branched-From: d897fb1-refs/heads/master@{#612437}
  • Loading branch information
jdoerrie committed Dec 5, 2018
1 parent a839b5a commit b1255a7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 39 deletions.
13 changes: 4 additions & 9 deletions chrome/browser/resources/settings/people_page/people_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,11 @@
</paper-icon-button-light>
</div>
</template>
</if>

<div id="manage-other-people-subpage-trigger"
class="settings-box" on-click="onManageOtherPeople_" actionable
hidden="[[isChild_]]">
<div class="start">$i18n{manageOtherPeople}</div>
<paper-icon-button-light class="subpage-arrow">
<button aria-label="$i18n{manageOtherPeople}"></button>
</paper-icon-button-light>
</div>
<cr-link-row id="manage-other-people-subpage-trigger"
label="$i18n{manageOtherPeople}" icon-class="subpage-arrow"
on-click="onManageOtherPeople_"></cr-link-row>
</if>

<if expr="not chromeos">
<div class="settings-box" on-click="onImportDataTap_" actionable>
Expand Down
9 changes: 2 additions & 7 deletions chrome/browser/resources/settings/people_page/people_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Polymer({
if (settings.routes.ACCOUNTS) {
map.set(
settings.routes.ACCOUNTS.path,
'#manage-other-people-subpage-trigger .subpage-arrow button');
'#manage-other-people-subpage-trigger');
}
if (settings.routes.ACCOUNT_MANAGER) {
map.set(
Expand Down Expand Up @@ -420,17 +420,12 @@ Polymer({
onAccountManagerTap_: function(e) {
settings.navigateTo(settings.routes.ACCOUNT_MANAGER);
},
// </if>

/** @private */
onManageOtherPeople_: function() {
// <if expr="not chromeos">
this.syncBrowserProxy_.manageOtherPeople();
// </if>
// <if expr="chromeos">
settings.navigateTo(settings.routes.ACCOUNTS);
// </if>
},
// </if>

// <if expr="not chromeos">
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ cr.define('settings', function() {
*/
pauseSync() {}

/**
* Opens the multi-profile user manager.
*/
manageOtherPeople() {}

/**
* @return {number} the number of times the sync account promo was shown.
*/
Expand Down Expand Up @@ -240,11 +235,6 @@ cr.define('settings', function() {
chrome.send('SyncSetupPauseSync');
}

/** @override */
manageOtherPeople() {
chrome.send('SyncSetupManageOtherPeople');
}

/** @override */
getPromoImpressionCount() {
return parseInt(
Expand Down
12 changes: 0 additions & 12 deletions chrome/browser/ui/webui/settings/people_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#include "components/signin/core/browser/signin_manager_base.h"
#else
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/ui/user_manager.h"
#include "chrome/browser/ui/webui/profile_helper.h"
#include "components/signin/core/browser/signin_manager.h"
#endif
Expand Down Expand Up @@ -262,10 +261,6 @@ void PeopleHandler::RegisterMessages() {
"SyncSetupGetSyncStatus",
base::BindRepeating(&PeopleHandler::HandleGetSyncStatus,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"SyncSetupManageOtherPeople",
base::BindRepeating(&PeopleHandler::HandleManageOtherPeople,
base::Unretained(this)));
#if defined(OS_CHROMEOS)
web_ui()->RegisterMessageCallback(
"AttemptUserExit",
Expand Down Expand Up @@ -830,13 +825,6 @@ void PeopleHandler::HandleGetSyncStatus(const base::ListValue* args) {
ResolveJavascriptCallback(*callback_id, *GetSyncStatusDictionary());
}

void PeopleHandler::HandleManageOtherPeople(const base::ListValue* /* args */) {
#if !defined(OS_CHROMEOS)
UserManager::Show(base::FilePath(),
profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
#endif // !defined(OS_CHROMEOS)
}

void PeopleHandler::CloseSyncSetup() {
// Stop a timer to handle timeout in waiting for checking network connection.
engine_start_timer_.reset();
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/ui/webui/settings/people_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class PeopleHandler : public SettingsPageUIHandler,
void HandlePauseSync(const base::ListValue* args);
#endif
void HandleGetSyncStatus(const base::ListValue* args);
void HandleManageOtherPeople(const base::ListValue* args);

#if !defined(OS_CHROMEOS)
// Displays the GAIA login form.
Expand Down

0 comments on commit b1255a7

Please sign in to comment.