diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 00:24:02 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 00:24:02 +0000 |
commit | ae46c8c689131bcbb15cec249e543dc91d8a606c (patch) | |
tree | 2bf2793799e45875ad5f9681549c4d0982546d12 /chrome/browser/automation/testing_automation_provider.cc | |
parent | c37683da5aa951af68da88e7cfa8c779fd2864a2 (diff) | |
download | chromium_src-ae46c8c689131bcbb15cec249e543dc91d8a606c.zip chromium_src-ae46c8c689131bcbb15cec249e543dc91d8a606c.tar.gz chromium_src-ae46c8c689131bcbb15cec249e543dc91d8a606c.tar.bz2 |
Importer: Remove ImporterList from ImporterHost and the pass-through methods.
Make callers of ImporterHost that need to enumerate source profiles create
ImporterList directly.
BUG=65638
TEST=none
Review URL: http://codereview.chromium.org/6334060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/testing_automation_provider.cc')
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 2d86dda..5690dfc 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -166,16 +166,16 @@ TestingAutomationProvider::~TestingAutomationProvider() { } void TestingAutomationProvider::SourceProfilesLoaded() { - DCHECK_NE(static_cast<ImporterHost*>(NULL), importer_host_.get()); + DCHECK_NE(static_cast<ImporterList*>(NULL), importer_list_.get()); // Get the correct ProfileInfo based on the browser the user provided. importer::ProfileInfo profile_info; - int num_browsers = importer_host_->GetAvailableProfileCount(); + int num_browsers = importer_list_->GetAvailableProfileCount(); int i = 0; for ( ; i < num_browsers; i++) { - string16 name = WideToUTF16Hack(importer_host_->GetSourceProfileNameAt(i)); + string16 name = WideToUTF16Hack(importer_list_->GetSourceProfileNameAt(i)); if (name == import_settings_data_.browser_name) { - profile_info = importer_host_->GetSourceProfileInfoAt(i); + profile_info = importer_list_->GetSourceProfileInfoAt(i); break; } } @@ -186,16 +186,17 @@ void TestingAutomationProvider::SourceProfilesLoaded() { return; } - importer_host_->SetObserver( + scoped_refptr<ImporterHost> importer_host(new ImporterHost); + importer_host->SetObserver( new AutomationProviderImportSettingsObserver( this, import_settings_data_.reply_message)); Profile* profile = import_settings_data_.browser->profile(); - importer_host_->StartImportSettings(profile_info, - profile, - import_settings_data_.import_items, - new ProfileWriter(profile), - import_settings_data_.first_run); + importer_host->StartImportSettings(profile_info, + profile, + import_settings_data_.import_items, + new ProfileWriter(profile), + import_settings_data_.first_run); } void TestingAutomationProvider::Observe(NotificationType type, @@ -3166,9 +3167,10 @@ void TestingAutomationProvider::ImportSettings(Browser* browser, import_settings_data_.reply_message = reply_message; // The remaining functionality of importing settings is in - // SourceProfilesLoaded(), which is called by |importer_host_| once the source + // SourceProfilesLoaded(), which is called by |importer_list_| once the source // profiles are loaded. - importer_host_ = new ImporterHost(this); + importer_list_ = new ImporterList; + importer_list_->DetectSourceProfiles(this); } namespace { |