OLD | NEW |
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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
444 if (out_prefs->do_import_items || !import_bookmarks_path.empty()) { | 444 if (out_prefs->do_import_items || !import_bookmarks_path.empty()) { |
445 // There is something to import from the default browser. This launches | 445 // There is something to import from the default browser. This launches |
446 // the importer process and blocks until done or until it fails. | 446 // the importer process and blocks until done or until it fails. |
447 scoped_refptr<ImporterList> importer_list(new ImporterList(NULL)); | 447 scoped_refptr<ImporterList> importer_list(new ImporterList(NULL)); |
448 importer_list->DetectSourceProfilesHack(); | 448 importer_list->DetectSourceProfilesHack(); |
449 if (!ImportSettingsWin( | 449 if (!ImportSettingsWin( |
450 NULL, importer_list->GetSourceProfileAt(0).importer_type, | 450 NULL, importer_list->GetSourceProfileAt(0).importer_type, |
451 out_prefs->do_import_items, | 451 out_prefs->do_import_items, base::FilePath::FromWStringHack(UTF8ToWide( |
452 base::FilePath::FromWStringHack( | 452 import_bookmarks_path)), true)) { |
453 base::UTF8ToWide(import_bookmarks_path)), true)) { | |
454 LOG(WARNING) << "silent import failed"; | 453 LOG(WARNING) << "silent import failed"; |
455 } | 454 } |
456 } | 455 } |
457 } | 456 } |
458 | 457 |
459 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { | 458 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { |
460 if (IsEULANotAccepted(install_prefs)) { | 459 if (IsEULANotAccepted(install_prefs)) { |
461 // Show the post-installation EULA. This is done by setup.exe and the | 460 // Show the post-installation EULA. This is done by setup.exe and the |
462 // result determines if we continue or not. We wait here until the user | 461 // result determines if we continue or not. We wait here until the user |
463 // dismisses the dialog. | 462 // dismisses the dialog. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 503 |
505 base::FilePath MasterPrefsPath() { | 504 base::FilePath MasterPrefsPath() { |
506 // The standard location of the master prefs is next to the chrome binary. | 505 // The standard location of the master prefs is next to the chrome binary. |
507 base::FilePath master_prefs; | 506 base::FilePath master_prefs; |
508 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | 507 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
509 return base::FilePath(); | 508 return base::FilePath(); |
510 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | 509 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
511 } | 510 } |
512 | 511 |
513 } // namespace first_run | 512 } // namespace first_run |
OLD | NEW |