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

Side by Side Diff: chrome/browser/ui/webui/settings/profile_info_handler.cc

Issue 2614883004: [MD Settings] Fixes the crash when navigating directly to chrome://md-settings/signOut (Closed)
Patch Set: fixed cros tests Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/settings/profile_info_handler.h" 5 #include "chrome/browser/ui/webui/settings/profile_info_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 CHECK_EQ(1U, args->GetSize()); 120 CHECK_EQ(1U, args->GetSize());
121 const base::Value* callback_id; 121 const base::Value* callback_id;
122 CHECK(args->Get(0, &callback_id)); 122 CHECK(args->Get(0, &callback_id));
123 123
124 ResolveJavascriptCallback(*callback_id, *GetAccountNameAndIcon()); 124 ResolveJavascriptCallback(*callback_id, *GetAccountNameAndIcon());
125 } 125 }
126 126
127 #if !defined(OS_CHROMEOS) 127 #if !defined(OS_CHROMEOS)
128 void ProfileInfoHandler::HandleGetProfileStats(const base::ListValue* args) { 128 void ProfileInfoHandler::HandleGetProfileStats(const base::ListValue* args) {
129 AllowJavascript();
130
129 // Because there is open browser window for the current profile, statistics 131 // Because there is open browser window for the current profile, statistics
130 // from the ProfileAttributesStorage may not be up-to-date or may be missing 132 // from the ProfileAttributesStorage may not be up-to-date or may be missing
131 // (e.g., |item.success| is false). Therefore, query the actual statistics. 133 // (e.g., |item.success| is false). Therefore, query the actual statistics.
132 ProfileStatisticsFactory::GetForProfile(profile_)->GatherStatistics( 134 ProfileStatisticsFactory::GetForProfile(profile_)->GatherStatistics(
133 base::Bind(&ProfileInfoHandler::PushProfileStatsCount, 135 base::Bind(&ProfileInfoHandler::PushProfileStatsCount,
134 base::Unretained(this))); 136 base::Unretained(this)));
135 } 137 }
136 138
137 void ProfileInfoHandler::PushProfileStatsCount( 139 void ProfileInfoHandler::PushProfileStatsCount(
138 profiles::ProfileCategoryStats stats) { 140 profiles::ProfileCategoryStats stats) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 response->SetString("name", name); 224 response->SetString("name", name);
223 response->SetString("iconUrl", icon_url); 225 response->SetString("iconUrl", icon_url);
224 return base::WrapUnique(response); 226 return base::WrapUnique(response);
225 } 227 }
226 228
227 bool ProfileInfoHandler::IsProfileManagingSupervisedUsers() const { 229 bool ProfileInfoHandler::IsProfileManagingSupervisedUsers() const {
228 return !profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); 230 return !profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty();
229 } 231 }
230 232
231 } // namespace settings 233 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.js ('k') | chrome/test/data/webui/settings/people_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698