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

Side by Side Diff: chrome/browser/chromeos/login/user_image_manager_impl.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to desired interfaces. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/user_image_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_image_manager_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/rand_util.h" 13 #include "base/rand_util.h"
14 #include "base/threading/worker_pool.h" 14 #include "base/threading/worker_pool.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chromeos/login/default_user_images.h" 18 #include "chrome/browser/chromeos/login/default_user_images.h"
19 #include "chrome/browser/chromeos/login/helper.h" 19 #include "chrome/browser/chromeos/login/helper.h"
20 #include "chrome/browser/chromeos/login/user_image.h" 20 #include "chrome/browser/chromeos/login/user_image.h"
21 #include "chrome/browser/chromeos/login/user_manager.h" 21 #include "chrome/browser/chromeos/login/user_manager.h"
22 #include "chrome/browser/prefs/pref_registry_simple.h"
22 #include "chrome/browser/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" 24 #include "chrome/browser/prefs/scoped_user_pref_update.h"
24 #include "chrome/browser/profiles/profile_downloader.h" 25 #include "chrome/browser/profiles/profile_downloader.h"
25 #include "chrome/browser/profiles/profile_manager.h" 26 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/browser/ui/webui/web_ui_util.h" 27 #include "chrome/browser/ui/webui/web_ui_util.h"
27 #include "chrome/common/chrome_notification_types.h" 28 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/chrome_paths.h" 29 #include "chrome/common/chrome_paths.h"
29 #include "content/public/browser/browser_thread.h" 30 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/notification_service.h" 31 #include "content/public/browser/notification_service.h"
31 #include "content/public/common/url_constants.h" 32 #include "content/public/common/url_constants.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 163 }
163 } 164 }
164 165
165 } // namespace 166 } // namespace
166 167
167 // static 168 // static
168 int UserImageManagerImpl::user_image_migration_delay_sec = 169 int UserImageManagerImpl::user_image_migration_delay_sec =
169 kUserImageMigrationDelaySec; 170 kUserImageMigrationDelaySec;
170 171
171 // static 172 // static
172 void UserImageManager::RegisterPrefs(PrefServiceSimple* local_state) { 173 void UserImageManager::RegisterPrefs(PrefRegistrySimple* local_state) {
173 local_state->RegisterDictionaryPref(kUserImages); 174 local_state->RegisterDictionaryPref(kUserImages);
174 local_state->RegisterDictionaryPref(kUserImageProperties); 175 local_state->RegisterDictionaryPref(kUserImageProperties);
175 } 176 }
176 177
177 UserImageManagerImpl::UserImageManagerImpl() 178 UserImageManagerImpl::UserImageManagerImpl()
178 : image_loader_(new UserImageLoader(ImageDecoder::ROBUST_JPEG_CODEC)), 179 : image_loader_(new UserImageLoader(ImageDecoder::ROBUST_JPEG_CODEC)),
179 unsafe_image_loader_(new UserImageLoader(ImageDecoder::DEFAULT_CODEC)), 180 unsafe_image_loader_(new UserImageLoader(ImageDecoder::DEFAULT_CODEC)),
180 last_image_set_async_(false), 181 last_image_set_async_(false),
181 downloaded_profile_image_data_url_(chrome::kAboutBlankURL), 182 downloaded_profile_image_data_url_(chrome::kAboutBlankURL),
182 downloading_profile_image_(false), 183 downloading_profile_image_(false),
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 if (prefs_images_update->GetDictionaryWithoutPathExpansion( 741 if (prefs_images_update->GetDictionaryWithoutPathExpansion(
741 username, &image_properties)) { 742 username, &image_properties)) {
742 std::string image_path; 743 std::string image_path;
743 image_properties->GetString(kImagePathNodeName, &image_path); 744 image_properties->GetString(kImagePathNodeName, &image_path);
744 prefs_images_update->RemoveWithoutPathExpansion(username, NULL); 745 prefs_images_update->RemoveWithoutPathExpansion(username, NULL);
745 DeleteImageFile(image_path); 746 DeleteImageFile(image_path);
746 } 747 }
747 } 748 }
748 749
749 } // namespace chromeos 750 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698