| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (queue->ShouldEnqueueTask(profile_, extension_)) { | 256 if (queue->ShouldEnqueueTask(profile_, extension_)) { |
| 257 queue->AddPendingTask( | 257 queue->AddPendingTask( |
| 258 profile_, | 258 profile_, |
| 259 extension_->id(), | 259 extension_->id(), |
| 260 base::Bind(&PlatformAppPathLauncher::GrantAccessToFilesAndLaunch, | 260 base::Bind(&PlatformAppPathLauncher::GrantAccessToFilesAndLaunch, |
| 261 this)); | 261 this)); |
| 262 return; | 262 return; |
| 263 } | 263 } |
| 264 | 264 |
| 265 extensions::ProcessManager* const process_manager = | 265 extensions::ProcessManager* const process_manager = |
| 266 ExtensionSystem::Get(profile_)->process_manager(); | 266 extensions::ProcessManager::Get(profile_); |
| 267 ExtensionHost* const host = | 267 ExtensionHost* const host = |
| 268 process_manager->GetBackgroundHostForExtension(extension_->id()); | 268 process_manager->GetBackgroundHostForExtension(extension_->id()); |
| 269 DCHECK(host); | 269 DCHECK(host); |
| 270 GrantAccessToFilesAndLaunch(host); | 270 GrantAccessToFilesAndLaunch(host); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void GrantAccessToFilesAndLaunch(ExtensionHost* host) { | 273 void GrantAccessToFilesAndLaunch(ExtensionHost* host) { |
| 274 // If there was an error loading the app page, |host| will be NULL. | 274 // If there was an error loading the app page, |host| will be NULL. |
| 275 if (!host) { | 275 if (!host) { |
| 276 LOG(ERROR) << "Could not load app page for " << extension_->id(); | 276 LOG(ERROR) << "Could not load app page for " << extension_->id(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 void LaunchPlatformAppWithUrl(Profile* profile, | 405 void LaunchPlatformAppWithUrl(Profile* profile, |
| 406 const Extension* extension, | 406 const Extension* extension, |
| 407 const std::string& handler_id, | 407 const std::string& handler_id, |
| 408 const GURL& url, | 408 const GURL& url, |
| 409 const GURL& referrer_url) { | 409 const GURL& referrer_url) { |
| 410 AppRuntimeEventRouter::DispatchOnLaunchedEventWithUrl( | 410 AppRuntimeEventRouter::DispatchOnLaunchedEventWithUrl( |
| 411 profile, extension, handler_id, url, referrer_url); | 411 profile, extension, handler_id, url, referrer_url); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace apps | 414 } // namespace apps |
| OLD | NEW |