| 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" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 17 #include "chrome/browser/extensions/sandboxed_unpacker.h" | |
| 18 #include "chrome/browser/extensions/webstore_startup_installer.h" | 17 #include "chrome/browser/extensions/webstore_startup_installer.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/extensions/chrome_extensions_client.h" | 20 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 22 #include "components/crx_file/id_util.h" | 21 #include "components/crx_file/id_util.h" |
| 23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "extensions/browser/sandboxed_unpacker.h" |
| 25 #include "extensions/common/extension.h" | 25 #include "extensions/common/extension.h" |
| 26 #include "ipc/ipc_message.h" | 26 #include "ipc/ipc_message.h" |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 #include "extensions/browser/app_window/app_window.h" | 29 #include "extensions/browser/app_window/app_window.h" |
| 30 #include "extensions/browser/app_window/app_window_registry.h" | 30 #include "extensions/browser/app_window/app_window_registry.h" |
| 31 #include "extensions/browser/extension_registry.h" | 31 #include "extensions/browser/extension_registry.h" |
| 32 #include "extensions/browser/extension_util.h" | 32 #include "extensions/browser/extension_util.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } else { | 291 } else { |
| 292 error_ = "Not a supported ephemeral app installation."; | 292 error_ = "Not a supported ephemeral app installation."; |
| 293 done_callback_.Run(); | 293 done_callback_.Run(); |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 void AppInstallHelper::OnAppInstallComplete(bool success, | 297 void AppInstallHelper::OnAppInstallComplete(bool success, |
| 298 const std::string& error, | 298 const std::string& error, |
| 299 webstore_install::Result result) { | 299 webstore_install::Result result) { |
| 300 success_ = success; | 300 success_ = success; |
| 301 error_= error; | 301 error_ = error; |
| 302 done_callback_.Run(); | 302 done_callback_.Run(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace | 305 } // namespace |
| 306 | 306 |
| 307 bool StartupHelper::InstallEphemeralApp(const base::CommandLine& cmd_line, | 307 bool StartupHelper::InstallEphemeralApp(const base::CommandLine& cmd_line, |
| 308 Profile* profile) { | 308 Profile* profile) { |
| 309 std::string id = | 309 std::string id = |
| 310 cmd_line.GetSwitchValueASCII(switches::kInstallEphemeralAppFromWebstore); | 310 cmd_line.GetSwitchValueASCII(switches::kInstallEphemeralAppFromWebstore); |
| 311 if (!crx_file::id_util::IdIsValid(id)) { | 311 if (!crx_file::id_util::IdIsValid(id)) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 323 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); | 323 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); |
| 324 return helper.success(); | 324 return helper.success(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 StartupHelper::~StartupHelper() { | 327 StartupHelper::~StartupHelper() { |
| 328 if (pack_job_.get()) | 328 if (pack_job_.get()) |
| 329 pack_job_->ClearClient(); | 329 pack_job_->ClearClient(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace extensions | 332 } // namespace extensions |
| OLD | NEW |