OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |