Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: chrome/browser/ui/webui/options/manage_profile_handler.cc

Issue 542843002: [Win] Don't show the add/remove desktop shortcut for single users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 void ManageProfileHandler::OnCreateSupervisedUserPrefChange() { 490 void ManageProfileHandler::OnCreateSupervisedUserPrefChange() {
491 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 491 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
492 base::FundamentalValue allowed( 492 base::FundamentalValue allowed(
493 prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed)); 493 prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed));
494 web_ui()->CallJavascriptFunction( 494 web_ui()->CallJavascriptFunction(
495 "CreateProfileOverlay.updateSupervisedUsersAllowed", allowed); 495 "CreateProfileOverlay.updateSupervisedUsersAllowed", allowed);
496 } 496 }
497 497
498 void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) { 498 void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) {
499 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 499 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
Dan Beam 2014/09/05 19:19:15 what happened to the flag check?
noms (inactive) 2014/09/05 19:50:37 Maybe I misunderstood your reply, but I thought yo
Dan Beam 2014/09/05 22:16:43 where is the code that hides the useless UI?
noms (inactive) 2014/09/08 14:30:18 Initially, in manage_profile_overlay.js, in didSho
500 const ProfileInfoCache& cache =
501 g_browser_process->profile_manager()->GetProfileInfoCache();
502
503 // Don't show the add/remove desktop shortcut button in the single user case.
504 if (cache.GetNumberOfProfiles() <= 1)
505 return;
500 506
501 const base::FundamentalValue has_shortcuts_value(has_shortcuts); 507 const base::FundamentalValue has_shortcuts_value(has_shortcuts);
502 web_ui()->CallJavascriptFunction( 508 web_ui()->CallJavascriptFunction(
503 "ManageProfileOverlay.receiveHasProfileShortcuts", has_shortcuts_value); 509 "ManageProfileOverlay.receiveHasProfileShortcuts", has_shortcuts_value);
504 } 510 }
505 511
506 void ManageProfileHandler::AddProfileShortcut(const base::ListValue* args) { 512 void ManageProfileHandler::AddProfileShortcut(const base::ListValue* args) {
507 base::FilePath profile_file_path; 513 base::FilePath profile_file_path;
508 if (!GetProfilePathFromArgs(args, &profile_file_path)) 514 if (!GetProfilePathFromArgs(args, &profile_file_path))
509 return; 515 return;
(...skipping 23 matching lines...) Expand all
533 539
534 // Update the UI buttons. 540 // Update the UI buttons.
535 OnHasProfileShortcuts(false); 541 OnHasProfileShortcuts(false);
536 } 542 }
537 543
538 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { 544 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) {
539 profiles::UpdateGaiaProfilePhotoIfNeeded(Profile::FromWebUI(web_ui())); 545 profiles::UpdateGaiaProfilePhotoIfNeeded(Profile::FromWebUI(web_ui()));
540 } 546 }
541 547
542 } // namespace options 548 } // namespace options
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698