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/importer/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
6 | 6 |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #include <urlhist.h> | 10 #include <urlhist.h> |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 | 412 |
413 IEImporter::IEImporter() { | 413 IEImporter::IEImporter() { |
414 } | 414 } |
415 | 415 |
416 void IEImporter::StartImport(const importer::SourceProfile& source_profile, | 416 void IEImporter::StartImport(const importer::SourceProfile& source_profile, |
417 uint16 items, | 417 uint16 items, |
418 ImporterBridge* bridge) { | 418 ImporterBridge* bridge) { |
419 bridge_ = bridge; | 419 bridge_ = bridge; |
420 source_path_ = source_profile.source_path; | 420 source_path_ = source_profile.source_path; |
421 | 421 |
422 // If there is indication that an override is required, but we fail to set it, | |
423 // prefer returning early to running the test with whatever is in the real | |
424 // registry. | |
425 if (!test_registry_overrider_.StartRegistryOverrideIfNeeded()) { | |
robertshield
2013/04/26 19:20:53
This doesn't disambiguate between the case where t
gab
2013/04/29 02:00:43
Agreed, changed the method to always return true o
| |
426 NOTREACHED(); | |
427 return; | |
428 } | |
429 | |
422 bridge_->NotifyStarted(); | 430 bridge_->NotifyStarted(); |
423 | 431 |
424 if ((items & importer::HOME_PAGE) && !cancelled()) | 432 if ((items & importer::HOME_PAGE) && !cancelled()) |
425 ImportHomepage(); // Doesn't have a UI item. | 433 ImportHomepage(); // Doesn't have a UI item. |
426 // The order here is important! | 434 // The order here is important! |
427 if ((items & importer::HISTORY) && !cancelled()) { | 435 if ((items & importer::HISTORY) && !cancelled()) { |
428 bridge_->NotifyItemStarted(importer::HISTORY); | 436 bridge_->NotifyItemStarted(importer::HISTORY); |
429 ImportHistory(); | 437 ImportHistory(); |
430 bridge_->NotifyItemEnded(importer::HISTORY); | 438 bridge_->NotifyItemEnded(importer::HISTORY); |
431 } | 439 } |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
884 static int version = -1; | 892 static int version = -1; |
885 if (version < 0) { | 893 if (version < 0) { |
886 wchar_t buffer[128]; | 894 wchar_t buffer[128]; |
887 DWORD buffer_length = sizeof(buffer); | 895 DWORD buffer_length = sizeof(buffer); |
888 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 896 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
889 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 897 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
890 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 898 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
891 } | 899 } |
892 return version; | 900 return version; |
893 } | 901 } |
OLD | NEW |