OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 // TODO(port): move more code in back from the first_run_win.cc module. | 9 // TODO(port): move more code in back from the first_run_win.cc module. |
10 | 10 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 return true; | 398 return true; |
399 } | 399 } |
400 | 400 |
401 // static | 401 // static |
402 int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) { | 402 int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) { |
403 FilePath file_path = cmdline.GetSwitchValuePath(switches::kImportFromFile); | 403 FilePath file_path = cmdline.GetSwitchValuePath(switches::kImportFromFile); |
404 if (file_path.empty()) { | 404 if (file_path.empty()) { |
405 NOTREACHED(); | 405 NOTREACHED(); |
406 return false; | 406 return false; |
407 } | 407 } |
408 scoped_refptr<ImporterHost> importer_host = new ImporterHost(); | 408 scoped_refptr<ImporterHost> importer_host(new ImporterHost()); |
409 FirstRunImportObserver observer; | 409 FirstRunImportObserver observer; |
410 | 410 |
411 importer_host->set_headless(); | 411 importer_host->set_headless(); |
412 | 412 |
413 ProfileInfo profile_info; | 413 ProfileInfo profile_info; |
414 profile_info.browser_type = importer::BOOKMARKS_HTML; | 414 profile_info.browser_type = importer::BOOKMARKS_HTML; |
415 profile_info.source_path = file_path; | 415 profile_info.source_path = file_path; |
416 | 416 |
417 StartImportingWithUI( | 417 StartImportingWithUI( |
418 NULL, | 418 NULL, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 if (!observer->ended()) { | 653 if (!observer->ended()) { |
654 observer->set_should_quit_message_loop(); | 654 observer->set_should_quit_message_loop(); |
655 MessageLoop::current()->Run(); | 655 MessageLoop::current()->Run(); |
656 } | 656 } |
657 | 657 |
658 // Unfortunately there's no success/fail signal in ImporterHost. | 658 // Unfortunately there's no success/fail signal in ImporterHost. |
659 return true; | 659 return true; |
660 } | 660 } |
661 | 661 |
662 #endif // OS_POSIX | 662 #endif // OS_POSIX |
OLD | NEW |