| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/importer/import_progress_dialog_view.h" | 5 #include "chrome/browser/ui/views/importer/import_progress_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/importer/importer_host.h" | 8 #include "chrome/browser/importer/importer_host.h" |
| 9 #include "chrome/browser/importer/importer_observer.h" | 9 #include "chrome/browser/importer/importer_observer.h" |
| 10 #include "chrome/browser/importer/importer_progress_dialog.h" | 10 #include "chrome/browser/importer/importer_progress_dialog.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 uint16 items, | 23 uint16 items, |
| 24 ImporterHost* importer_host, | 24 ImporterHost* importer_host, |
| 25 ImporterObserver* importer_observer, | 25 ImporterObserver* importer_observer, |
| 26 const string16& importer_name, | 26 const string16& importer_name, |
| 27 bool bookmarks_import) | 27 bool bookmarks_import) |
| 28 : state_bookmarks_(new views::CheckmarkThrobber), | 28 : state_bookmarks_(new views::CheckmarkThrobber), |
| 29 state_searches_(new views::CheckmarkThrobber), | 29 state_searches_(new views::CheckmarkThrobber), |
| 30 state_passwords_(new views::CheckmarkThrobber), | 30 state_passwords_(new views::CheckmarkThrobber), |
| 31 state_history_(new views::CheckmarkThrobber), | 31 state_history_(new views::CheckmarkThrobber), |
| 32 state_cookies_(new views::CheckmarkThrobber), | 32 state_cookies_(new views::CheckmarkThrobber), |
| 33 label_bookmarks_(new views::Label( | 33 label_bookmarks_(new views::Label(UTF16ToWide( |
| 34 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_BOOKMARKS))), | 34 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_BOOKMARKS)))), |
| 35 label_searches_(new views::Label( | 35 label_searches_(new views::Label(UTF16ToWide( |
| 36 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_SEARCH))), | 36 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_SEARCH)))), |
| 37 label_passwords_(new views::Label( | 37 label_passwords_(new views::Label(UTF16ToWide( |
| 38 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_PASSWORDS))), | 38 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_PASSWORDS)))), |
| 39 label_history_(new views::Label( | 39 label_history_(new views::Label(UTF16ToWide( |
| 40 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_HISTORY))), | 40 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_HISTORY)))), |
| 41 label_cookies_(new views::Label( | 41 label_cookies_(new views::Label(UTF16ToWide( |
| 42 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_COOKIES))), | 42 l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_COOKIES)))), |
| 43 parent_window_(parent_window), | 43 parent_window_(parent_window), |
| 44 items_(items), | 44 items_(items), |
| 45 importer_host_(importer_host), | 45 importer_host_(importer_host), |
| 46 importer_observer_(importer_observer), | 46 importer_observer_(importer_observer), |
| 47 importing_(true), | 47 importing_(true), |
| 48 bookmarks_import_(bookmarks_import) { | 48 bookmarks_import_(bookmarks_import) { |
| 49 std::wstring info_text = bookmarks_import ? | 49 std::wstring info_text = bookmarks_import ? |
| 50 UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORT_BOOKMARKS)) : | 50 UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORT_BOOKMARKS)) : |
| 51 UTF16ToWide(l10n_util::GetStringFUTF16( | 51 UTF16ToWide(l10n_util::GetStringFUTF16( |
| 52 IDS_IMPORT_PROGRESS_INFO, importer_name)); | 52 IDS_IMPORT_PROGRESS_INFO, importer_name)); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 namespace importer { | 283 namespace importer { |
| 284 | 284 |
| 285 void ShowImportProgressDialog(HWND parent_window, | 285 void ShowImportProgressDialog(HWND parent_window, |
| 286 uint16 items, | 286 uint16 items, |
| 287 ImporterHost* importer_host, | 287 ImporterHost* importer_host, |
| 288 ImporterObserver* importer_observer, | 288 ImporterObserver* importer_observer, |
| 289 const SourceProfile& source_profile, | 289 const SourceProfile& source_profile, |
| 290 Profile* target_profile, | 290 Profile* target_profile, |
| 291 bool first_run) { | 291 bool first_run) { |
| 292 DCHECK_NE(items, 0u); | 292 DCHECK(items != 0); |
| 293 ImportProgressDialogView* progress_view = new ImportProgressDialogView( | 293 ImportProgressDialogView* progress_view = new ImportProgressDialogView( |
| 294 parent_window, | 294 parent_window, |
| 295 items, | 295 items, |
| 296 importer_host, | 296 importer_host, |
| 297 importer_observer, | 297 importer_observer, |
| 298 source_profile.importer_name, | 298 source_profile.importer_name, |
| 299 source_profile.importer_type == importer::TYPE_BOOKMARKS_FILE); | 299 source_profile.importer_type == importer::TYPE_BOOKMARKS_FILE); |
| 300 | 300 |
| 301 views::Widget* window = | 301 views::Widget* window = |
| 302 views::Widget::CreateWindowWithParent(progress_view, parent_window); | 302 views::Widget::CreateWindowWithParent(progress_view, parent_window); |
| 303 | 303 |
| 304 if (!importer_host->is_headless() && !first_run) | 304 if (!importer_host->is_headless() && !first_run) |
| 305 window->Show(); | 305 window->Show(); |
| 306 | 306 |
| 307 importer_host->StartImportSettings( | 307 importer_host->StartImportSettings( |
| 308 source_profile, target_profile, items, new ProfileWriter(target_profile), | 308 source_profile, target_profile, items, new ProfileWriter(target_profile), |
| 309 first_run); | 309 first_run); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace importer | 312 } // namespace importer |
| OLD | NEW |