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/extensions/startup_helper.h" | 5 #include "chrome/browser/extensions/startup_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
24 #include "extensions/common/extension.h" | 24 #include "extensions/common/extension.h" |
25 #include "ipc/ipc_message.h" | 25 #include "ipc/ipc_message.h" |
26 | 26 |
27 using content::BrowserThread; | 27 using content::BrowserThread; |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 void PrintPackExtensionMessage(const std::string& message) { | 31 void PrintPackExtensionMessage(const std::string& message) { |
32 printf("%s\n", message.c_str()); | 32 VLOG(1) << message; |
33 } | 33 } |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 namespace extensions { | 37 namespace extensions { |
38 | 38 |
39 StartupHelper::StartupHelper() : pack_job_succeeded_(false) { | 39 StartupHelper::StartupHelper() : pack_job_succeeded_(false) { |
40 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); | 40 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); |
41 } | 41 } |
42 | 42 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 virtual ~AppInstallHelper(); | 206 virtual ~AppInstallHelper(); |
207 bool success() { return success_; } | 207 bool success() { return success_; } |
208 const std::string& error() { return error_; } | 208 const std::string& error() { return error_; } |
209 void BeginInstall(Profile* profile, | 209 void BeginInstall(Profile* profile, |
210 const std::string& id, | 210 const std::string& id, |
211 bool show_prompt, | 211 bool show_prompt, |
212 DoneCallback callback); | 212 DoneCallback callback); |
213 | 213 |
214 private: | 214 private: |
215 WebstoreStandaloneInstaller::Callback Callback(); | 215 WebstoreStandaloneInstaller::Callback Callback(); |
216 void OnAppInstallComplete(bool success, const std::string& error); | 216 void OnAppInstallComplete(bool success, |
| 217 const std::string& error, |
| 218 webstore_install::Result result); |
217 | 219 |
218 DoneCallback done_callback_; | 220 DoneCallback done_callback_; |
219 | 221 |
220 // These hold on to the result of the app install when it is complete. | 222 // These hold on to the result of the app install when it is complete. |
221 bool success_; | 223 bool success_; |
222 std::string error_; | 224 std::string error_; |
223 | 225 |
224 scoped_refptr<WebstoreStandaloneInstaller> installer_; | 226 scoped_refptr<WebstoreStandaloneInstaller> installer_; |
225 }; | 227 }; |
226 | 228 |
(...skipping 18 matching lines...) Expand all Loading... |
245 base::Unretained(this)); | 247 base::Unretained(this)); |
246 installer_ = new WebstoreStartupInstaller( | 248 installer_ = new WebstoreStartupInstaller( |
247 id, | 249 id, |
248 profile, | 250 profile, |
249 show_prompt, | 251 show_prompt, |
250 callback); | 252 callback); |
251 installer_->BeginInstall(); | 253 installer_->BeginInstall(); |
252 } | 254 } |
253 | 255 |
254 void AppInstallHelper::OnAppInstallComplete(bool success, | 256 void AppInstallHelper::OnAppInstallComplete(bool success, |
255 const std::string& error) { | 257 const std::string& error, |
| 258 webstore_install::Result result) { |
256 success_ = success; | 259 success_ = success; |
257 error_= error; | 260 error_= error; |
258 done_callback_.Run(); | 261 done_callback_.Run(); |
259 } | 262 } |
260 | 263 |
261 void DeleteHelperAndRunCallback(AppInstallHelper* helper, | 264 void DeleteHelperAndRunCallback(AppInstallHelper* helper, |
262 base::Callback<void()> callback) { | 265 base::Callback<void()> callback) { |
263 delete helper; | 266 delete helper; |
264 callback.Run(); | 267 callback.Run(); |
265 } | 268 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 317 } |
315 return id; | 318 return id; |
316 } | 319 } |
317 | 320 |
318 StartupHelper::~StartupHelper() { | 321 StartupHelper::~StartupHelper() { |
319 if (pack_job_.get()) | 322 if (pack_job_.get()) |
320 pack_job_->ClearClient(); | 323 pack_job_->ClearClient(); |
321 } | 324 } |
322 | 325 |
323 } // namespace extensions | 326 } // namespace extensions |
OLD | NEW |