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/importer/profile_import_process_host.h" | 5 #include "chrome/browser/importer/profile_import_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 11 #include "base/values.h" |
11 #include "chrome/browser/importer/firefox_importer_utils.h" | 12 #include "chrome/browser/importer/firefox_importer_utils.h" |
12 #include "chrome/browser/importer/profile_import_process_client.h" | 13 #include "chrome/browser/importer/profile_import_process_client.h" |
13 #include "chrome/browser/importer/profile_import_process_messages.h" | 14 #include "chrome/browser/importer/profile_import_process_messages.h" |
14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 #include "ipc/ipc_switches.h" | 17 #include "ipc/ipc_switches.h" |
17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
18 | 19 |
19 ProfileImportProcessHost::ProfileImportProcessHost( | 20 ProfileImportProcessHost::ProfileImportProcessHost( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
73 Send(new ProfileImportProcessMsg_ReportImportItemFinished(item)); | 74 Send(new ProfileImportProcessMsg_ReportImportItemFinished(item)); |
74 return true; | 75 return true; |
75 } | 76 } |
76 | 77 |
77 FilePath ProfileImportProcessHost::GetProfileImportProcessCmd() { | 78 FilePath ProfileImportProcessHost::GetProfileImportProcessCmd() { |
78 return GetChildPath(true); | 79 return GetChildPath(true); |
79 } | 80 } |
80 | 81 |
81 bool ProfileImportProcessHost::StartProcess() { | 82 bool ProfileImportProcessHost::StartProcess() { |
82 set_name(L"profile import process"); | 83 set_name(ASCIIToUTF16("profile import process")); |
83 | 84 |
84 if (!CreateChannel()) | 85 if (!CreateChannel()) |
85 return false; | 86 return false; |
86 | 87 |
87 FilePath exe_path = GetProfileImportProcessCmd(); | 88 FilePath exe_path = GetProfileImportProcessCmd(); |
88 if (exe_path.empty()) { | 89 if (exe_path.empty()) { |
89 NOTREACHED() << "Unable to get profile import process binary name."; | 90 NOTREACHED() << "Unable to get profile import process binary name."; |
90 return false; | 91 return false; |
91 } | 92 } |
92 | 93 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 BrowserThread::PostTask( | 135 BrowserThread::PostTask( |
135 thread_id_, FROM_HERE, | 136 thread_id_, FROM_HERE, |
136 NewRunnableMethod(import_process_client_.get(), | 137 NewRunnableMethod(import_process_client_.get(), |
137 &ProfileImportProcessClient::OnProcessCrashed, | 138 &ProfileImportProcessClient::OnProcessCrashed, |
138 exit_code)); | 139 exit_code)); |
139 } | 140 } |
140 | 141 |
141 bool ProfileImportProcessHost::CanShutdown() { | 142 bool ProfileImportProcessHost::CanShutdown() { |
142 return true; | 143 return true; |
143 } | 144 } |
OLD | NEW |