| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // The order of these includes is important. | 5 // The order of these includes is important. |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <unknwn.h> | 7 #include <unknwn.h> |
| 8 #include <intshcut.h> | 8 #include <intshcut.h> |
| 9 #include <shlguid.h> | 9 #include <shlguid.h> |
| 10 #include <urlhist.h> | 10 #include <urlhist.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
| 23 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
| 24 #include "base/string16.h" | 24 #include "base/string16.h" |
| 25 #include "base/string_util.h" | 25 #include "base/string_util.h" |
| 26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
| 27 #include "base/win/registry.h" | 27 #include "base/win/registry.h" |
| 28 #include "base/win/scoped_comptr.h" | 28 #include "base/win/scoped_comptr.h" |
| 29 #include "base/win/scoped_propvariant.h" | 29 #include "base/win/scoped_propvariant.h" |
| 30 #include "base/win/windows_version.h" | 30 #include "base/win/windows_version.h" |
| 31 #include "chrome/browser/history/history_types.h" | 31 #include "chrome/browser/history/history_types.h" |
| 32 #include "chrome/browser/importer/external_process_importer_host.h" |
| 32 #include "chrome/browser/importer/ie_importer.h" | 33 #include "chrome/browser/importer/ie_importer.h" |
| 33 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" | 34 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" |
| 34 #include "chrome/browser/importer/importer_bridge.h" | 35 #include "chrome/browser/importer/importer_bridge.h" |
| 35 #include "chrome/browser/importer/importer_data_types.h" | 36 #include "chrome/browser/importer/importer_data_types.h" |
| 36 #include "chrome/browser/importer/importer_host.h" | 37 #include "chrome/browser/importer/importer_host.h" |
| 37 #include "chrome/browser/importer/importer_progress_observer.h" | 38 #include "chrome/browser/importer/importer_progress_observer.h" |
| 38 #include "chrome/browser/importer/importer_unittest_utils.h" | 39 #include "chrome/browser/importer/importer_unittest_utils.h" |
| 39 #include "chrome/browser/importer/pstore_declarations.h" | 40 #include "chrome/browser/importer/pstore_declarations.h" |
| 40 #include "chrome/browser/search_engines/template_url.h" | 41 #include "chrome/browser/search_engines/template_url.h" |
| 41 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 481 |
| 481 // Sets up a special history link. | 482 // Sets up a special history link. |
| 482 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; | 483 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; |
| 483 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, | 484 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, |
| 484 CLSCTX_INPROC_SERVER); | 485 CLSCTX_INPROC_SERVER); |
| 485 ASSERT_TRUE(res == S_OK); | 486 ASSERT_TRUE(res == S_OK); |
| 486 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); | 487 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); |
| 487 ASSERT_TRUE(res == S_OK); | 488 ASSERT_TRUE(res == S_OK); |
| 488 | 489 |
| 489 // Starts to import the above settings. | 490 // Starts to import the above settings. |
| 490 // TODO(gab): Use ExternalProcessImporterHost on Windows. | 491 scoped_refptr<ImporterHost> host(new ExternalProcessImporterHost); |
| 491 scoped_refptr<ImporterHost> host(new ImporterHost); | |
| 492 TestObserver* observer = new TestObserver(); | 492 TestObserver* observer = new TestObserver(); |
| 493 host->SetObserver(observer); | 493 host->SetObserver(observer); |
| 494 | 494 |
| 495 importer::SourceProfile source_profile; | 495 importer::SourceProfile source_profile; |
| 496 source_profile.importer_type = importer::TYPE_IE; | 496 source_profile.importer_type = importer::TYPE_IE; |
| 497 source_profile.source_path = temp_dir_.path(); | 497 source_profile.source_path = temp_dir_.path(); |
| 498 | 498 |
| 499 host->StartImportSettings( | 499 host->StartImportSettings( |
| 500 source_profile, | 500 source_profile, |
| 501 browser()->profile(), | 501 browser()->profile(), |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 // sort is performed. | 555 // sort is performed. |
| 556 for (size_t i = 0; i < arraysize(kBadBinary); ++i) { | 556 for (size_t i = 0; i < arraysize(kBadBinary); ++i) { |
| 557 base::win::RegKey key; | 557 base::win::RegKey key; |
| 558 ASSERT_EQ(ERROR_SUCCESS, | 558 ASSERT_EQ(ERROR_SUCCESS, |
| 559 key.Create(HKEY_CURRENT_USER, kIEFavoritesOrderKey, KEY_WRITE)); | 559 key.Create(HKEY_CURRENT_USER, kIEFavoritesOrderKey, KEY_WRITE)); |
| 560 ASSERT_EQ(ERROR_SUCCESS, | 560 ASSERT_EQ(ERROR_SUCCESS, |
| 561 key.WriteValue(L"Order", kBadBinary[i].data, kBadBinary[i].length, | 561 key.WriteValue(L"Order", kBadBinary[i].data, kBadBinary[i].length, |
| 562 REG_BINARY)); | 562 REG_BINARY)); |
| 563 | 563 |
| 564 // Starts to import the above settings. | 564 // Starts to import the above settings. |
| 565 // TODO(gab): Use ExternalProcessImporterHost on Windows. | 565 scoped_refptr<ImporterHost> host(new ExternalProcessImporterHost); |
| 566 scoped_refptr<ImporterHost> host(new ImporterHost); | |
| 567 MalformedFavoritesRegistryTestObserver* observer = | 566 MalformedFavoritesRegistryTestObserver* observer = |
| 568 new MalformedFavoritesRegistryTestObserver(); | 567 new MalformedFavoritesRegistryTestObserver(); |
| 569 host->SetObserver(observer); | 568 host->SetObserver(observer); |
| 570 | 569 |
| 571 importer::SourceProfile source_profile; | 570 importer::SourceProfile source_profile; |
| 572 source_profile.importer_type = importer::TYPE_IE; | 571 source_profile.importer_type = importer::TYPE_IE; |
| 573 source_profile.source_path = temp_dir_.path(); | 572 source_profile.source_path = temp_dir_.path(); |
| 574 | 573 |
| 575 host->StartImportSettings( | 574 host->StartImportSettings( |
| 576 source_profile, | 575 source_profile, |
| 577 browser()->profile(), | 576 browser()->profile(), |
| 578 importer::FAVORITES, | 577 importer::FAVORITES, |
| 579 observer); | 578 observer); |
| 580 MessageLoop::current()->Run(); | 579 MessageLoop::current()->Run(); |
| 581 } | 580 } |
| 582 } | 581 } |
| OLD | NEW |