| OLD | NEW |
| 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 "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // TODO(crbug.com/710660): return chrome://theme/IDR_PROFILE_AVATAR_* | 197 // TODO(crbug.com/710660): return chrome://theme/IDR_PROFILE_AVATAR_* |
| 198 // and update theme_source.cc to get high res avatar icons. This does less | 198 // and update theme_source.cc to get high res avatar icons. This does less |
| 199 // work here, sends less over IPC, and is more stable with returned results. | 199 // work here, sends less over IPC, and is more stable with returned results. |
| 200 int kAvatarIconSize = 40.f * web_ui()->GetDeviceScaleFactor(); | 200 int kAvatarIconSize = 40.f * web_ui()->GetDeviceScaleFactor(); |
| 201 gfx::Image icon = profiles::GetSizedAvatarIcon( | 201 gfx::Image icon = profiles::GetSizedAvatarIcon( |
| 202 entry->GetAvatarIcon(), true, kAvatarIconSize, kAvatarIconSize); | 202 entry->GetAvatarIcon(), true, kAvatarIconSize, kAvatarIconSize); |
| 203 icon_url = webui::GetBitmapDataUrl(icon.AsBitmap()); | 203 icon_url = webui::GetBitmapDataUrl(icon.AsBitmap()); |
| 204 } | 204 } |
| 205 #endif // defined(OS_CHROMEOS) | 205 #endif // defined(OS_CHROMEOS) |
| 206 | 206 |
| 207 base::DictionaryValue* response = new base::DictionaryValue(); | 207 auto response = base::MakeUnique<base::DictionaryValue>(); |
| 208 response->SetString("name", name); | 208 response->SetString("name", name); |
| 209 response->SetString("iconUrl", icon_url); | 209 response->SetString("iconUrl", icon_url); |
| 210 return base::WrapUnique(response); | 210 return response; |
| 211 } | 211 } |
| 212 | 212 |
| 213 bool ProfileInfoHandler::IsProfileManagingSupervisedUsers() const { | 213 bool ProfileInfoHandler::IsProfileManagingSupervisedUsers() const { |
| 214 return !profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); | 214 return !profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace settings | 217 } // namespace settings |
| OLD | NEW |