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

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 2915053002: Replace profile statistics preference count with AutofillCounter (Closed)
Patch Set: change to SetBooleanWithoutPathExpansion Created 3 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/signin/user_manager_screen_handler.h" 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 } 626 }
627 627
628 void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback( 628 void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback(
629 base::FilePath profile_path, 629 base::FilePath profile_path,
630 base::Time start_time, 630 base::Time start_time,
631 profiles::ProfileCategoryStats result) { 631 profiles::ProfileCategoryStats result) {
632 // Copy result into return_value. 632 // Copy result into return_value.
633 base::DictionaryValue return_value; 633 base::DictionaryValue return_value;
634 for (const auto& item : result) { 634 for (const auto& item : result) {
635 std::unique_ptr<base::DictionaryValue> stat(new base::DictionaryValue); 635 auto stat = base::MakeUnique<base::DictionaryValue>();
636 stat->SetIntegerWithoutPathExpansion("count", item.count); 636 stat->SetIntegerWithoutPathExpansion("count", item.count);
637 stat->SetBooleanWithoutPathExpansion("success", item.success); 637 stat->SetBooleanWithoutPathExpansion("success", true);
638 return_value.SetWithoutPathExpansion(item.category, std::move(stat)); 638 return_value.SetWithoutPathExpansion(item.category, std::move(stat));
639 } 639 }
640 if (result.size() == profiles::kProfileStatisticsCategories.size()) { 640 if (result.size() == profiles::kProfileStatisticsCategories.size()) {
641 // All categories are finished. 641 // All categories are finished.
642 UMA_HISTOGRAM_TIMES("Profile.RemoveUserWarningStatsTime", 642 UMA_HISTOGRAM_TIMES("Profile.RemoveUserWarningStatsTime",
643 base::Time::Now() - start_time); 643 base::Time::Now() - start_time);
644 } 644 }
645 web_ui()->CallJavascriptFunctionUnsafe("updateRemoveWarningDialog", 645 web_ui()->CallJavascriptFunctionUnsafe("updateRemoveWarningDialog",
646 base::Value(profile_path.value()), 646 base::Value(profile_path.value()),
647 return_value); 647 return_value);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_NOSTATS)); 795 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_NOSTATS));
796 localized_strings->SetString("removeUserWarningTextNonSyncCalculating", 796 localized_strings->SetString("removeUserWarningTextNonSyncCalculating",
797 l10n_util::GetStringUTF16( 797 l10n_util::GetStringUTF16(
798 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_CALCULATING)); 798 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_CALCULATING));
799 localized_strings->SetString("removeUserWarningTextHistory", 799 localized_strings->SetString("removeUserWarningTextHistory",
800 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_HISTORY)); 800 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_HISTORY));
801 localized_strings->SetString("removeUserWarningTextPasswords", 801 localized_strings->SetString("removeUserWarningTextPasswords",
802 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_PASSWORDS)); 802 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_PASSWORDS));
803 localized_strings->SetString("removeUserWarningTextBookmarks", 803 localized_strings->SetString("removeUserWarningTextBookmarks",
804 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BOOKMARKS)); 804 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BOOKMARKS));
805 localized_strings->SetString("removeUserWarningTextSettings", 805 localized_strings->SetString(
806 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_SETTINGS)); 806 "removeUserWarningTextAutofill",
807 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_AUTOFILL));
807 localized_strings->SetString("removeUserWarningTextCalculating", 808 localized_strings->SetString("removeUserWarningTextCalculating",
808 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_CALCULATING)); 809 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_CALCULATING));
809 localized_strings->SetString("removeUserWarningTextSyncNoStats", 810 localized_strings->SetString("removeUserWarningTextSyncNoStats",
810 l10n_util::GetStringUTF16( 811 l10n_util::GetStringUTF16(
811 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_NOSTATS)); 812 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_NOSTATS));
812 localized_strings->SetString("removeUserWarningTextSyncCalculating", 813 localized_strings->SetString("removeUserWarningTextSyncCalculating",
813 l10n_util::GetStringUTF16( 814 l10n_util::GetStringUTF16(
814 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_CALCULATING)); 815 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_CALCULATING));
815 localized_strings->SetString("removeLegacySupervisedUserWarningText", 816 localized_strings->SetString("removeLegacySupervisedUserWarningText",
816 l10n_util::GetStringFUTF16( 817 l10n_util::GetStringFUTF16(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 Profile* profile, Profile::CreateStatus profile_create_status) { 1042 Profile* profile, Profile::CreateStatus profile_create_status) {
1042 Browser* browser = chrome::FindAnyBrowser(profile, false); 1043 Browser* browser = chrome::FindAnyBrowser(profile, false);
1043 if (browser && browser->window()) { 1044 if (browser && browser->window()) {
1044 OnBrowserWindowReady(browser); 1045 OnBrowserWindowReady(browser);
1045 } else { 1046 } else {
1046 registrar_.Add(this, 1047 registrar_.Add(this,
1047 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 1048 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
1048 content::NotificationService::AllSources()); 1049 content::NotificationService::AllSources());
1049 } 1050 }
1050 } 1051 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/profile_info_handler.cc ('k') | ui/login/account_picker/md_user_pod_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698