OLD | NEW |
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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/importer/importer_progress_dialog.h" | 28 #include "chrome/browser/importer/importer_progress_dialog.h" |
29 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
31 #include "chrome/common/chrome_result_codes.h" | 31 #include "chrome/common/chrome_result_codes.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/worker_thread_ticker.h" | 33 #include "chrome/common/worker_thread_ticker.h" |
34 #include "chrome/installer/util/browser_distribution.h" | 34 #include "chrome/installer/util/browser_distribution.h" |
35 #include "chrome/installer/util/google_update_constants.h" | 35 #include "chrome/installer/util/google_update_constants.h" |
36 #include "chrome/installer/util/google_update_settings.h" | 36 #include "chrome/installer/util/google_update_settings.h" |
37 #include "chrome/installer/util/install_util.h" | 37 #include "chrome/installer/util/install_util.h" |
| 38 #include "chrome/installer/util/master_preferences.h" |
38 #include "chrome/installer/util/shell_util.h" | 39 #include "chrome/installer/util/shell_util.h" |
39 #include "chrome/installer/util/util_constants.h" | 40 #include "chrome/installer/util/util_constants.h" |
40 #include "content/browser/user_metrics.h" | 41 #include "content/browser/user_metrics.h" |
41 #include "content/common/notification_service.h" | 42 #include "content/common/notification_service.h" |
42 #include "google_update_idl.h" | 43 #include "google_update_idl.h" |
43 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
44 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
45 #include "grit/locale_settings.h" | 46 #include "grit/locale_settings.h" |
46 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
47 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 302 } |
302 | 303 |
303 // static | 304 // static |
304 bool FirstRun::IsOrganicFirstRun() { | 305 bool FirstRun::IsOrganicFirstRun() { |
305 std::wstring brand; | 306 std::wstring brand; |
306 GoogleUpdateSettings::GetBrand(&brand); | 307 GoogleUpdateSettings::GetBrand(&brand); |
307 return GoogleUpdateSettings::IsOrganicFirstRun(brand); | 308 return GoogleUpdateSettings::IsOrganicFirstRun(brand); |
308 } | 309 } |
309 | 310 |
310 // static | 311 // static |
| 312 FilePath FirstRun::MasterPrefsPath() { |
| 313 // The standard location of the master prefs is next to the chrome binary. |
| 314 FilePath master_prefs; |
| 315 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 316 return FilePath(); |
| 317 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 318 } |
| 319 |
| 320 // static |
311 bool FirstRun::ImportSettings(Profile* profile, | 321 bool FirstRun::ImportSettings(Profile* profile, |
312 int importer_type, | 322 int importer_type, |
313 int items_to_import, | 323 int items_to_import, |
314 const FilePath& import_bookmarks_path, | 324 const FilePath& import_bookmarks_path, |
315 bool skip_first_run_ui, | 325 bool skip_first_run_ui, |
316 HWND parent_window) { | 326 HWND parent_window) { |
317 const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); | 327 const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); |
318 CommandLine import_cmd(cmdline.GetProgram()); | 328 CommandLine import_cmd(cmdline.GetProgram()); |
319 | 329 |
320 const char* kSwitchNames[] = { | 330 const char* kSwitchNames[] = { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 parent_window, | 414 parent_window, |
405 static_cast<uint16>(items_to_import), | 415 static_cast<uint16>(items_to_import), |
406 importer_host, | 416 importer_host, |
407 &importer_observer, | 417 &importer_observer, |
408 importer_list->GetSourceProfileForImporterType(importer_type), | 418 importer_list->GetSourceProfileForImporterType(importer_type), |
409 profile, | 419 profile, |
410 true); | 420 true); |
411 importer_observer.RunLoop(); | 421 importer_observer.RunLoop(); |
412 return importer_observer.import_result(); | 422 return importer_observer.import_result(); |
413 } | 423 } |
OLD | NEW |