OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 ImportEndedObserver observer; | 61 ImportEndedObserver observer; |
62 importer_host->SetObserver(&observer); | 62 importer_host->SetObserver(&observer); |
63 importer_host->StartImportSettings(source_profile, | 63 importer_host->StartImportSettings(source_profile, |
64 profile, | 64 profile, |
65 items_to_import, | 65 items_to_import, |
66 new ProfileWriter(profile)); | 66 new ProfileWriter(profile)); |
67 // If the import process has not errored out, block on it. | 67 // If the import process has not errored out, block on it. |
68 if (!observer.ended()) { | 68 if (!observer.ended()) { |
69 observer.set_should_quit_message_loop(); | 69 observer.set_should_quit_message_loop(); |
70 MessageLoop::current()->Run(); | 70 base::MessageLoop::current()->Run(); |
71 } | 71 } |
72 | 72 |
73 // Unfortunately there's no success/fail signal in ImporterHost. | 73 // Unfortunately there's no success/fail signal in ImporterHost. |
74 return true; | 74 return true; |
75 } | 75 } |
76 | 76 |
77 void SetImportPreferencesAndLaunchImport( | 77 void SetImportPreferencesAndLaunchImport( |
78 MasterPrefs* out_prefs, | 78 MasterPrefs* out_prefs, |
79 installer::MasterPreferences* install_prefs) { | 79 installer::MasterPreferences* install_prefs) { |
80 std::string import_bookmarks_path; | 80 std::string import_bookmarks_path; |
(...skipping 21 matching lines...) Expand all Loading... |
102 namespace first_run { | 102 namespace first_run { |
103 | 103 |
104 // TODO(port): Import switches need to be ported to both Mac and Linux. Not all | 104 // TODO(port): Import switches need to be ported to both Mac and Linux. Not all |
105 // import switches here are implemented for Linux. None are implemented for Mac | 105 // import switches here are implemented for Linux. None are implemented for Mac |
106 // (as this function will not be called on Mac). | 106 // (as this function will not be called on Mac). |
107 int ImportNow(Profile* profile, const CommandLine& cmdline) { | 107 int ImportNow(Profile* profile, const CommandLine& cmdline) { |
108 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); | 108 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); |
109 } | 109 } |
110 | 110 |
111 } // namespace first_run | 111 } // namespace first_run |
OLD | NEW |