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

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

Issue 478543002: [Profiles] Add a new kind of "default name" for the new profiles UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/app/generated_resources.grd ('k') | no next file » | 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) 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/profiles/profile_info_cache.h" 5 #include "chrome/browser/profiles/profile_info_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 *out_image = new gfx::Image(image); 132 *out_image = new gfx::Image(image);
133 } 133 }
134 134
135 void DeleteBitmap(const base::FilePath& image_path) { 135 void DeleteBitmap(const base::FilePath& image_path) {
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
137 base::DeleteFile(image_path, false); 137 base::DeleteFile(image_path, false);
138 } 138 }
139 139
140 bool IsDefaultName(const base::string16& name) { 140 bool IsDefaultName(const base::string16& name) {
141 // Check if it's a "First user" old-style name. 141 // Check if it's a "First user" old-style name.
142 if (name == l10n_util::GetStringUTF16(IDS_DEFAULT_PROFILE_NAME)) 142 if (name == l10n_util::GetStringUTF16(IDS_DEFAULT_PROFILE_NAME) ||
143 name == l10n_util::GetStringUTF16(IDS_LEGACY_DEFAULT_PROFILE_NAME))
143 return true; 144 return true;
144 145
145 // Check if it's one of the old-style profile names. 146 // Check if it's one of the old-style profile names.
146 for (size_t i = 0; i < arraysize(kDefaultNames); ++i) { 147 for (size_t i = 0; i < arraysize(kDefaultNames); ++i) {
147 if (name == l10n_util::GetStringUTF16(kDefaultNames[i])) 148 if (name == l10n_util::GetStringUTF16(kDefaultNames[i]))
148 return true; 149 return true;
149 } 150 }
150 151
151 // Check whether it's one of the "Person %d" style names. 152 // Check whether it's one of the "Person %d" style names.
152 std::string default_name_format = l10n_util::GetStringFUTF8( 153 std::string default_name_format = l10n_util::GetStringFUTF8(
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 OnProfileAvatarChanged(profile_path)); 1050 OnProfileAvatarChanged(profile_path));
1050 1051
1051 // Remove the file from the list of downloads in progress. Note that this list 1052 // Remove the file from the list of downloads in progress. Note that this list
1052 // only contains the high resolution avatars, and not the Gaia profile images. 1053 // only contains the high resolution avatars, and not the Gaia profile images.
1053 if (!avatar_images_downloads_in_progress_[file_name]) 1054 if (!avatar_images_downloads_in_progress_[file_name])
1054 return; 1055 return;
1055 1056
1056 delete avatar_images_downloads_in_progress_[file_name]; 1057 delete avatar_images_downloads_in_progress_[file_name];
1057 avatar_images_downloads_in_progress_[file_name] = NULL; 1058 avatar_images_downloads_in_progress_[file_name] = NULL;
1058 } 1059 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698