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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // support. If there is no overlap, skip. | 56 // support. If there is no overlap, skip. |
57 items_to_import &= source_profile.services_supported; | 57 items_to_import &= source_profile.services_supported; |
58 if (items_to_import == 0) | 58 if (items_to_import == 0) |
59 return true; | 59 return true; |
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 true); | |
68 // If the import process has not errored out, block on it. | 67 // If the import process has not errored out, block on it. |
69 if (!observer.ended()) { | 68 if (!observer.ended()) { |
70 observer.set_should_quit_message_loop(); | 69 observer.set_should_quit_message_loop(); |
71 MessageLoop::current()->Run(); | 70 MessageLoop::current()->Run(); |
72 } | 71 } |
73 | 72 |
74 // Unfortunately there's no success/fail signal in ImporterHost. | 73 // Unfortunately there's no success/fail signal in ImporterHost. |
75 return true; | 74 return true; |
76 } | 75 } |
77 | 76 |
(...skipping 25 matching lines...) Expand all Loading... |
103 namespace first_run { | 102 namespace first_run { |
104 | 103 |
105 // 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 |
106 // 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 |
107 // (as this function will not be called on Mac). | 106 // (as this function will not be called on Mac). |
108 int ImportNow(Profile* profile, const CommandLine& cmdline) { | 107 int ImportNow(Profile* profile, const CommandLine& cmdline) { |
109 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); | 108 return internal::ImportBookmarkFromFileIfNeeded(profile, cmdline); |
110 } | 109 } |
111 | 110 |
112 } // namespace first_run | 111 } // namespace first_run |
OLD | NEW |