| 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" | 17 #include "chrome/browser/extensions/sandboxed_unpacker.h" |
| 18 #include "chrome/browser/extensions/webstore_startup_installer.h" | 18 #include "chrome/browser/extensions/webstore_startup_installer.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/extensions/chrome_extensions_client.h" | 21 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 22 #include "components/crx_file/id_util.h" | 22 #include "components/crx_file/id_util.h" |
| 23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.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 "apps/app_window.h" | 29 #include "extensions/browser/app_window/app_window.h" |
| 30 #include "apps/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 |
| 35 using content::BrowserThread; | 35 using content::BrowserThread; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 void PrintPackExtensionMessage(const std::string& message) { | 39 void PrintPackExtensionMessage(const std::string& message) { |
| 40 VLOG(1) << message; | 40 VLOG(1) << message; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 53 using extensions::ExtensionRegistry; | 53 using extensions::ExtensionRegistry; |
| 54 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); | 54 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); |
| 55 DCHECK(registry); | 55 DCHECK(registry); |
| 56 if (!registry->GetExtensionById(app_id, ExtensionRegistry::EVERYTHING) || | 56 if (!registry->GetExtensionById(app_id, ExtensionRegistry::EVERYTHING) || |
| 57 !extensions::util::IsEphemeralApp(app_id, profile)) { | 57 !extensions::util::IsEphemeralApp(app_id, profile)) { |
| 58 return installer; | 58 return installer; |
| 59 } | 59 } |
| 60 | 60 |
| 61 apps::AppWindowRegistry* app_window_registry = | 61 extensions::AppWindowRegistry* app_window_registry = |
| 62 apps::AppWindowRegistry::Get(profile); | 62 extensions::AppWindowRegistry::Get(profile); |
| 63 DCHECK(app_window_registry); | 63 DCHECK(app_window_registry); |
| 64 apps::AppWindow* app_window = | 64 extensions::AppWindow* app_window = |
| 65 app_window_registry->GetCurrentAppWindowForApp(app_id); | 65 app_window_registry->GetCurrentAppWindowForApp(app_id); |
| 66 if (!app_window) | 66 if (!app_window) |
| 67 return installer; | 67 return installer; |
| 68 | 68 |
| 69 installer = new extensions::WebstoreInstallWithPrompt( | 69 installer = new extensions::WebstoreInstallWithPrompt( |
| 70 app_id, profile, app_window->GetNativeWindow(), callback); | 70 app_id, profile, app_window->GetNativeWindow(), callback); |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 return installer; | 73 return installer; |
| 74 } | 74 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 return id; | 360 return id; |
| 361 } | 361 } |
| 362 | 362 |
| 363 StartupHelper::~StartupHelper() { | 363 StartupHelper::~StartupHelper() { |
| 364 if (pack_job_.get()) | 364 if (pack_job_.get()) |
| 365 pack_job_->ClearClient(); | 365 pack_job_->ClearClient(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace extensions | 368 } // namespace extensions |
| OLD | NEW |