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

Side by Side Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/profile_info_cache.h" 5 #include "chrome/browser/profiles/profile_info_cache.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/prefs/pref_service.h" 15 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/prefs/scoped_user_pref_update.h" 16 #include "chrome/browser/prefs/scoped_user_pref_update.h"
17 #include "chrome/common/chrome_notification_types.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "content/common/notification_service.h" 19 #include "content/common/notification_service.h"
19 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
20 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
21 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
22 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
23 24
24 namespace { 25 namespace {
25 26
26 const char kNameKey[] = "name"; 27 const char kNameKey[] = "name";
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 return info; 238 return info;
238 } 239 }
239 240
240 void ProfileInfoCache::SetInfoForProfileAtIndex(size_t index, 241 void ProfileInfoCache::SetInfoForProfileAtIndex(size_t index,
241 DictionaryValue* info) { 242 DictionaryValue* info) {
242 DictionaryPrefUpdate update(prefs_, prefs::kProfileInfoCache); 243 DictionaryPrefUpdate update(prefs_, prefs::kProfileInfoCache);
243 DictionaryValue* cache = update.Get(); 244 DictionaryValue* cache = update.Get();
244 cache->Set(sorted_keys_[index], info); 245 cache->Set(sorted_keys_[index], info);
245 246
246 NotificationService::current()->Notify( 247 NotificationService::current()->Notify(
247 NotificationType::PROFILE_CACHED_INFO_CHANGED, 248 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
248 NotificationService::AllSources(), 249 NotificationService::AllSources(),
249 NotificationService::NoDetails()); 250 NotificationService::NoDetails());
250 } 251 }
251 252
252 std::string ProfileInfoCache::CacheKeyFromProfilePath( 253 std::string ProfileInfoCache::CacheKeyFromProfilePath(
253 const FilePath& profile_path) const { 254 const FilePath& profile_path) const {
254 DCHECK(user_data_dir_ == profile_path.DirName()); 255 DCHECK(user_data_dir_ == profile_path.DirName());
255 FilePath base_name = profile_path.BaseName(); 256 FilePath base_name = profile_path.BaseName();
256 return base_name.MaybeAsASCII(); 257 return base_name.MaybeAsASCII();
257 } 258 }
(...skipping 10 matching lines...) Expand all
268 if (key_compare < 0) 269 if (key_compare < 0)
269 return sorted_keys_.begin() + i; 270 return sorted_keys_.begin() + i;
270 } 271 }
271 } 272 }
272 return sorted_keys_.end(); 273 return sorted_keys_.end();
273 } 274 }
274 275
275 void ProfileInfoCache::RegisterPrefs(PrefService* prefs) { 276 void ProfileInfoCache::RegisterPrefs(PrefService* prefs) {
276 prefs->RegisterDictionaryPref(prefs::kProfileInfoCache); 277 prefs->RegisterDictionaryPref(prefs::kProfileInfoCache);
277 } 278 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698