OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // proceed because ImportSettings will launch the importer process which | 384 // proceed because ImportSettings will launch the importer process which |
385 // would end up here if the sentinel is not present. | 385 // would end up here if the sentinel is not present. |
386 if (!FirstRun::CreateSentinel()) | 386 if (!FirstRun::CreateSentinel()) |
387 return false; | 387 return false; |
388 | 388 |
389 if (installer_util::GetDistroBooleanPreference(prefs.get(), | 389 if (installer_util::GetDistroBooleanPreference(prefs.get(), |
390 installer_util::master_preferences::kDistroShowWelcomePage, &value) && | 390 installer_util::master_preferences::kDistroShowWelcomePage, &value) && |
391 value) | 391 value) |
392 FirstRun::SetShowWelcomePagePref(); | 392 FirstRun::SetShowWelcomePagePref(); |
393 | 393 |
394 std::wstring import_bookmarks_path; | 394 std::string import_bookmarks_path; |
395 installer_util::GetDistroStringPreference(prefs.get(), | 395 installer_util::GetDistroStringPreference(prefs.get(), |
396 installer_util::master_preferences::kDistroImportBookmarksFromFilePref, | 396 installer_util::master_preferences::kDistroImportBookmarksFromFilePref, |
397 &import_bookmarks_path); | 397 &import_bookmarks_path); |
398 | 398 |
399 if (import_items || !import_bookmarks_path.empty()) { | 399 if (import_items || !import_bookmarks_path.empty()) { |
400 // There is something to import from the default browser. This launches | 400 // There is something to import from the default browser. This launches |
401 // the importer process and blocks until done or until it fails. | 401 // the importer process and blocks until done or until it fails. |
402 scoped_refptr<ImporterHost> importer_host = new ImporterHost(); | 402 scoped_refptr<ImporterHost> importer_host = new ImporterHost(); |
403 if (!FirstRun::ImportSettings(NULL, | 403 if (!FirstRun::ImportSettings(NULL, |
404 importer_host->GetSourceProfileInfoAt(0).browser_type, | 404 importer_host->GetSourceProfileInfoAt(0).browser_type, import_items, |
405 import_items, FilePath(import_bookmarks_path), true, NULL)) { | 405 FilePath::FromWStringHack(UTF8ToWide(import_bookmarks_path)), |
| 406 true, NULL)) { |
406 LOG(WARNING) << "silent import failed"; | 407 LOG(WARNING) << "silent import failed"; |
407 } | 408 } |
408 } | 409 } |
409 | 410 |
410 return false; | 411 return false; |
411 } | 412 } |
412 | 413 |
413 bool Upgrade::IsBrowserAlreadyRunning() { | 414 bool Upgrade::IsBrowserAlreadyRunning() { |
414 static HANDLE handle = NULL; | 415 static HANDLE handle = NULL; |
415 std::wstring exe; | 416 std::wstring exe; |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1067 |
1067 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { | 1068 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { |
1068 if (version > 10000) { | 1069 if (version > 10000) { |
1069 // This is a test value. We want to make sure we exercise | 1070 // This is a test value. We want to make sure we exercise |
1070 // returning this early. See EarlyReturnTest test harness. | 1071 // returning this early. See EarlyReturnTest test harness. |
1071 return Upgrade::TD_NOT_NOW; | 1072 return Upgrade::TD_NOT_NOW; |
1072 } | 1073 } |
1073 TryChromeDialog td; | 1074 TryChromeDialog td; |
1074 return td.ShowModal(); | 1075 return td.ShowModal(); |
1075 } | 1076 } |
OLD | NEW |