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

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 'Browsing History' to 'Browsing history' 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 628 }
629 } 629 }
630 630
631 void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback( 631 void UserManagerScreenHandler::RemoveUserDialogLoadStatsCallback(
632 base::FilePath profile_path, 632 base::FilePath profile_path,
633 base::Time start_time, 633 base::Time start_time,
634 profiles::ProfileCategoryStats result) { 634 profiles::ProfileCategoryStats result) {
635 // Copy result into return_value. 635 // Copy result into return_value.
636 base::DictionaryValue return_value; 636 base::DictionaryValue return_value;
637 for (const auto& item : result) { 637 for (const auto& item : result) {
638 std::unique_ptr<base::DictionaryValue> stat(new base::DictionaryValue); 638 auto stat = base::MakeUnique<base::DictionaryValue>();
639 stat->SetIntegerWithoutPathExpansion("count", item.count); 639 stat->SetIntegerWithoutPathExpansion("count", item.count);
640 stat->SetBooleanWithoutPathExpansion("success", item.success); 640 stat->SetIntegerWithoutPathExpansion("success", true);
michaelpg 2017/06/07 18:25:54 should this be removed as well? if not, why Boolea
dullweber 2017/06/08 10:55:55 oh, thanks for catching this. I removed it at fir
641 return_value.SetWithoutPathExpansion(item.category, std::move(stat)); 641 return_value.SetWithoutPathExpansion(item.category, std::move(stat));
642 } 642 }
643 if (result.size() == profiles::kProfileStatisticsCategories.size()) { 643 if (result.size() == profiles::kProfileStatisticsCategories.size()) {
644 // All categories are finished. 644 // All categories are finished.
645 UMA_HISTOGRAM_TIMES("Profile.RemoveUserWarningStatsTime", 645 UMA_HISTOGRAM_TIMES("Profile.RemoveUserWarningStatsTime",
646 base::Time::Now() - start_time); 646 base::Time::Now() - start_time);
647 } 647 }
648 web_ui()->CallJavascriptFunctionUnsafe("updateRemoveWarningDialog", 648 web_ui()->CallJavascriptFunctionUnsafe("updateRemoveWarningDialog",
649 base::Value(profile_path.value()), 649 base::Value(profile_path.value()),
650 return_value); 650 return_value);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_NOSTATS)); 798 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_NOSTATS));
799 localized_strings->SetString("removeUserWarningTextNonSyncCalculating", 799 localized_strings->SetString("removeUserWarningTextNonSyncCalculating",
800 l10n_util::GetStringUTF16( 800 l10n_util::GetStringUTF16(
801 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_CALCULATING)); 801 IDS_LOGIN_POD_USER_REMOVE_WARNING_NONSYNC_CALCULATING));
802 localized_strings->SetString("removeUserWarningTextHistory", 802 localized_strings->SetString("removeUserWarningTextHistory",
803 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_HISTORY)); 803 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_HISTORY));
804 localized_strings->SetString("removeUserWarningTextPasswords", 804 localized_strings->SetString("removeUserWarningTextPasswords",
805 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_PASSWORDS)); 805 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_PASSWORDS));
806 localized_strings->SetString("removeUserWarningTextBookmarks", 806 localized_strings->SetString("removeUserWarningTextBookmarks",
807 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BOOKMARKS)); 807 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BOOKMARKS));
808 localized_strings->SetString("removeUserWarningTextSettings", 808 localized_strings->SetString(
809 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_SETTINGS)); 809 "removeUserWarningTextAutofill",
810 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_AUTOFILL));
810 localized_strings->SetString("removeUserWarningTextCalculating", 811 localized_strings->SetString("removeUserWarningTextCalculating",
811 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_CALCULATING)); 812 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_CALCULATING));
812 localized_strings->SetString("removeUserWarningTextSyncNoStats", 813 localized_strings->SetString("removeUserWarningTextSyncNoStats",
813 l10n_util::GetStringUTF16( 814 l10n_util::GetStringUTF16(
814 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_NOSTATS)); 815 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_NOSTATS));
815 localized_strings->SetString("removeUserWarningTextSyncCalculating", 816 localized_strings->SetString("removeUserWarningTextSyncCalculating",
816 l10n_util::GetStringUTF16( 817 l10n_util::GetStringUTF16(
817 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_CALCULATING)); 818 IDS_LOGIN_POD_USER_REMOVE_WARNING_SYNC_CALCULATING));
818 localized_strings->SetString("removeLegacySupervisedUserWarningText", 819 localized_strings->SetString("removeLegacySupervisedUserWarningText",
819 l10n_util::GetStringFUTF16( 820 l10n_util::GetStringFUTF16(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 Profile* profile, Profile::CreateStatus profile_create_status) { 1045 Profile* profile, Profile::CreateStatus profile_create_status) {
1045 Browser* browser = chrome::FindAnyBrowser(profile, false); 1046 Browser* browser = chrome::FindAnyBrowser(profile, false);
1046 if (browser && browser->window()) { 1047 if (browser && browser->window()) {
1047 OnBrowserWindowReady(browser); 1048 OnBrowserWindowReady(browser);
1048 } else { 1049 } else {
1049 registrar_.Add(this, 1050 registrar_.Add(this,
1050 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 1051 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
1051 content::NotificationService::AllSources()); 1052 content::NotificationService::AllSources());
1052 } 1053 }
1053 } 1054 }
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