| 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 12 matching lines...) Expand all Loading... |
| 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/bookmarks/imported_bookmark_entry.h" | 31 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" |
| 32 #include "chrome/browser/favicon/imported_favicon_usage.h" | 32 #include "chrome/browser/favicon/imported_favicon_usage.h" |
| 33 #include "chrome/browser/importer/external_process_importer_host.h" |
| 33 #include "chrome/browser/importer/ie_importer.h" | 34 #include "chrome/browser/importer/ie_importer.h" |
| 34 #include "chrome/browser/importer/ie_importer_utils_win.h" | 35 #include "chrome/browser/importer/ie_importer_utils_win.h" |
| 35 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" | 36 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" |
| 36 #include "chrome/browser/importer/importer_bridge.h" | 37 #include "chrome/browser/importer/importer_bridge.h" |
| 37 #include "chrome/browser/importer/importer_data_types.h" | 38 #include "chrome/browser/importer/importer_data_types.h" |
| 38 #include "chrome/browser/importer/importer_host.h" | 39 #include "chrome/browser/importer/importer_host.h" |
| 39 #include "chrome/browser/importer/importer_progress_observer.h" | 40 #include "chrome/browser/importer/importer_progress_observer.h" |
| 40 #include "chrome/browser/importer/importer_unittest_utils.h" | 41 #include "chrome/browser/importer/importer_unittest_utils.h" |
| 41 #include "chrome/browser/importer/pstore_declarations.h" | 42 #include "chrome/browser/importer/pstore_declarations.h" |
| 42 #include "chrome/browser/search_engines/template_url.h" | 43 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 // Sets up a special history link. | 480 // Sets up a special history link. |
| 480 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; | 481 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; |
| 481 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, | 482 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, |
| 482 CLSCTX_INPROC_SERVER); | 483 CLSCTX_INPROC_SERVER); |
| 483 ASSERT_TRUE(res == S_OK); | 484 ASSERT_TRUE(res == S_OK); |
| 484 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); | 485 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); |
| 485 ASSERT_TRUE(res == S_OK); | 486 ASSERT_TRUE(res == S_OK); |
| 486 | 487 |
| 487 // Starts to import the above settings. | 488 // Starts to import the above settings. |
| 488 // Deletes itself. | 489 // Deletes itself. |
| 489 // TODO(gab): Use ExternalProcessImporterHost on Windows. | 490 ImporterHost* host = new ExternalProcessImporterHost; |
| 490 ImporterHost* host = new ImporterHost; | |
| 491 TestObserver* observer = new TestObserver(); | 491 TestObserver* observer = new TestObserver(); |
| 492 host->SetObserver(observer); | 492 host->SetObserver(observer); |
| 493 | 493 |
| 494 importer::SourceProfile source_profile; | 494 importer::SourceProfile source_profile; |
| 495 source_profile.importer_type = importer::TYPE_IE; | 495 source_profile.importer_type = importer::TYPE_IE; |
| 496 source_profile.source_path = temp_dir_.path(); | 496 source_profile.source_path = temp_dir_.path(); |
| 497 | 497 |
| 498 host->StartImportSettings( | 498 host->StartImportSettings( |
| 499 source_profile, | 499 source_profile, |
| 500 browser()->profile(), | 500 browser()->profile(), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 base::string16 key_path(importer::GetIEFavoritesOrderKey()); | 556 base::string16 key_path(importer::GetIEFavoritesOrderKey()); |
| 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, key_path.c_str(), KEY_WRITE)); | 559 key.Create(HKEY_CURRENT_USER, key_path.c_str(), 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 // Deletes itself. | 565 // Deletes itself. |
| 566 // TODO(gab): Use ExternalProcessImporterHost on Windows. | 566 ImporterHost* host = new ExternalProcessImporterHost; |
| 567 ImporterHost* host = new ImporterHost; | |
| 568 MalformedFavoritesRegistryTestObserver* observer = | 567 MalformedFavoritesRegistryTestObserver* observer = |
| 569 new MalformedFavoritesRegistryTestObserver(); | 568 new MalformedFavoritesRegistryTestObserver(); |
| 570 host->SetObserver(observer); | 569 host->SetObserver(observer); |
| 571 | 570 |
| 572 importer::SourceProfile source_profile; | 571 importer::SourceProfile source_profile; |
| 573 source_profile.importer_type = importer::TYPE_IE; | 572 source_profile.importer_type = importer::TYPE_IE; |
| 574 source_profile.source_path = temp_dir_.path(); | 573 source_profile.source_path = temp_dir_.path(); |
| 575 | 574 |
| 576 host->StartImportSettings( | 575 host->StartImportSettings( |
| 577 source_profile, | 576 source_profile, |
| 578 browser()->profile(), | 577 browser()->profile(), |
| 579 importer::FAVORITES, | 578 importer::FAVORITES, |
| 580 observer); | 579 observer); |
| 581 MessageLoop::current()->Run(); | 580 MessageLoop::current()->Run(); |
| 582 } | 581 } |
| 583 } | 582 } |
| OLD | NEW |