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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 if (service) 482 if (service)
483 state = service->GetAuthError().state(); 483 state = service->GetAuthError().state();
484 484
485 bool has_error = (!service || 485 bool has_error = (!service ||
486 state == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS || 486 state == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS ||
487 state == GoogleServiceAuthError::USER_NOT_SIGNED_UP || 487 state == GoogleServiceAuthError::USER_NOT_SIGNED_UP ||
488 state == GoogleServiceAuthError::ACCOUNT_DELETED || 488 state == GoogleServiceAuthError::ACCOUNT_DELETED ||
489 state == GoogleServiceAuthError::ACCOUNT_DISABLED); 489 state == GoogleServiceAuthError::ACCOUNT_DISABLED);
490 web_ui()->CallJavascriptFunctionUnsafe( 490 web_ui()->CallJavascriptFunctionUnsafe(
491 "CreateProfileOverlay.updateSignedInStatus", base::StringValue(username), 491 "CreateProfileOverlay.updateSignedInStatus", base::StringValue(username),
492 base::FundamentalValue(has_error)); 492 base::Value(has_error));
493 493
494 OnCreateSupervisedUserPrefChange(); 494 OnCreateSupervisedUserPrefChange();
495 } 495 }
496 496
497 void ManageProfileHandler::OnCreateSupervisedUserPrefChange() { 497 void ManageProfileHandler::OnCreateSupervisedUserPrefChange() {
498 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 498 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
499 base::FundamentalValue allowed( 499 base::Value allowed(prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed));
500 prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed));
501 web_ui()->CallJavascriptFunctionUnsafe( 500 web_ui()->CallJavascriptFunctionUnsafe(
502 "CreateProfileOverlay.updateSupervisedUsersAllowed", allowed); 501 "CreateProfileOverlay.updateSupervisedUsersAllowed", allowed);
503 } 502 }
504 503
505 void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) { 504 void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) {
506 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 505 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
507 506
508 const base::FundamentalValue has_shortcuts_value(has_shortcuts); 507 const base::Value has_shortcuts_value(has_shortcuts);
509 web_ui()->CallJavascriptFunctionUnsafe( 508 web_ui()->CallJavascriptFunctionUnsafe(
510 "ManageProfileOverlay.receiveHasProfileShortcuts", has_shortcuts_value); 509 "ManageProfileOverlay.receiveHasProfileShortcuts", has_shortcuts_value);
511 } 510 }
512 511
513 void ManageProfileHandler::AddProfileShortcut(const base::ListValue* args) { 512 void ManageProfileHandler::AddProfileShortcut(const base::ListValue* args) {
514 base::FilePath profile_file_path; 513 base::FilePath profile_file_path;
515 if (!GetProfilePathFromArgs(args, &profile_file_path)) 514 if (!GetProfilePathFromArgs(args, &profile_file_path))
516 return; 515 return;
517 516
518 DCHECK(ProfileShortcutManager::IsFeatureEnabled()); 517 DCHECK(ProfileShortcutManager::IsFeatureEnabled());
(...skipping 21 matching lines...) Expand all
540 539
541 // Update the UI buttons. 540 // Update the UI buttons.
542 OnHasProfileShortcuts(false); 541 OnHasProfileShortcuts(false);
543 } 542 }
544 543
545 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { 544 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) {
546 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); 545 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui()));
547 } 546 }
548 547
549 } // namespace options 548 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/import_data_handler.cc ('k') | chrome/browser/ui/webui/options/password_manager_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698