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

Side by Side Diff: chrome/browser/importer/firefox_importer_utils.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 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/importer/firefox_importer_utils.h" 5 #include "chrome/browser/importer/firefox_importer_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 }; 49 };
50 } // namespace 50 } // namespace
51 51
52 base::FilePath GetFirefoxProfilePath() { 52 base::FilePath GetFirefoxProfilePath() {
53 DictionaryValue root; 53 DictionaryValue root;
54 base::FilePath ini_file = GetProfilesINI(); 54 base::FilePath ini_file = GetProfilesINI();
55 ParseProfileINI(ini_file, &root); 55 ParseProfileINI(ini_file, &root);
56 56
57 base::FilePath source_path; 57 base::FilePath source_path;
58 for (int i = 0; ; ++i) { 58 for (int i = 0; ; ++i) {
59 std::string current_profile = StringPrintf("Profile%d", i); 59 std::string current_profile = base::StringPrintf("Profile%d", i);
60 if (!root.HasKey(current_profile)) { 60 if (!root.HasKey(current_profile)) {
61 // Profiles are continuously numbered. So we exit when we can't 61 // Profiles are continuously numbered. So we exit when we can't
62 // find the i-th one. 62 // find the i-th one.
63 break; 63 break;
64 } 64 }
65 std::string is_relative; 65 std::string is_relative;
66 string16 path16; 66 string16 path16;
67 if (root.GetStringASCII(current_profile + ".IsRelative", &is_relative) && 67 if (root.GetStringASCII(current_profile + ".IsRelative", &is_relative) &&
68 root.GetString(current_profile + ".Path", &path16)) { 68 root.GetString(current_profile + ".Path", &path16)) {
69 #if defined(OS_WIN) 69 #if defined(OS_WIN)
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 } 460 }
461 } 461 }
462 } 462 }
463 463
464 StringToLowerASCII(&branding_name); 464 StringToLowerASCII(&branding_name);
465 if (branding_name.find("iceweasel") != std::string::npos) 465 if (branding_name.find("iceweasel") != std::string::npos)
466 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); 466 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL);
467 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); 467 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX);
468 } 468 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698