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

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

Issue 10830098: Get the Firefox branding name dynamically (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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
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/importer_list.h" 5 #include "chrome/browser/importer/importer_list.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/first_run/first_run.h" 8 #include "chrome/browser/first_run/first_run.h"
9 #include "chrome/browser/importer/firefox_importer_utils.h" 9 #include "chrome/browser/importer/firefox_importer_utils.h"
10 #include "chrome/browser/importer/importer_bridge.h" 10 #include "chrome/browser/importer/importer_bridge.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 version = GetCurrentFirefoxMajorVersionFromRegistry(); 68 version = GetCurrentFirefoxMajorVersionFromRegistry();
69 #endif 69 #endif
70 if (version < 2) 70 if (version < 2)
71 GetFirefoxVersionAndPathFromProfile(profile_path, &version, &app_path); 71 GetFirefoxVersionAndPathFromProfile(profile_path, &version, &app_path);
72 72
73 if (version == 2) { 73 if (version == 2) {
74 firefox_type = importer::TYPE_FIREFOX2; 74 firefox_type = importer::TYPE_FIREFOX2;
75 } else if (version >= 3) { 75 } else if (version >= 3) {
76 firefox_type = importer::TYPE_FIREFOX3; 76 firefox_type = importer::TYPE_FIREFOX3;
77 } else { 77 } else {
78 // Ignores other versions of firefox. 78 LOG(WARNING) << "Importing from Firefox version " << version
79 << " is not supported.";
Ilya Sherman 2012/08/03 23:12:29 Please revert this change. Chrome generally only
cristian.patrasciuc 2012/08/07 15:46:49 Done.
79 return; 80 return;
80 } 81 }
81 82
82 importer::SourceProfile* firefox = new importer::SourceProfile; 83 importer::SourceProfile* firefox = new importer::SourceProfile;
83 firefox->importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); 84 const std::string branding_name = GetFirefoxBrandingName(app_path);
Ilya Sherman 2012/08/03 23:12:29 I would suggestion moving the below if-else logic
cristian.patrasciuc 2012/08/06 15:12:39 This will make unit tests depend on l10n/generated
Ilya Sherman 2012/08/06 21:07:37 That's ok.
cristian.patrasciuc 2012/08/07 15:46:49 Done.
85 if (branding_name.find("Iceweasel") != std::string::npos ||
86 branding_name.find("iceweasel") != std::string::npos) {
87 firefox->importer_name =
88 l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL);
89 } else {
90 firefox->importer_name =
91 l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX);
92 }
84 firefox->importer_type = firefox_type; 93 firefox->importer_type = firefox_type;
85 firefox->source_path = profile_path; 94 firefox->source_path = profile_path;
86 #if defined(OS_WIN) 95 #if defined(OS_WIN)
87 firefox->app_path = GetFirefoxInstallPathFromRegistry(); 96 firefox->app_path = GetFirefoxInstallPathFromRegistry();
88 #endif 97 #endif
89 if (firefox->app_path.empty()) 98 if (firefox->app_path.empty())
90 firefox->app_path = app_path; 99 firefox->app_path = app_path;
91 firefox->services_supported = importer::HISTORY | importer::FAVORITES | 100 firefox->services_supported = importer::HISTORY | importer::FAVORITES |
92 importer::PASSWORDS | importer::SEARCH_ENGINES; 101 importer::PASSWORDS | importer::SEARCH_ENGINES;
93 profiles->push_back(firefox); 102 profiles->push_back(firefox);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 source_profiles_.assign(profiles.begin(), profiles.end()); 233 source_profiles_.assign(profiles.begin(), profiles.end());
225 source_profiles_loaded_ = true; 234 source_profiles_loaded_ = true;
226 source_thread_id_ = BrowserThread::UI; 235 source_thread_id_ = BrowserThread::UI;
227 236
228 observer_->OnSourceProfilesLoaded(); 237 observer_->OnSourceProfilesLoaded();
229 observer_ = NULL; 238 observer_ = NULL;
230 239
231 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed. 240 // TODO(jhawkins): Remove once DetectSourceProfilesHack is removed.
232 is_observed_ = false; 241 is_observed_ = false;
233 } 242 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698