Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6538)

Unified Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 10804020: Introduce runtime.onSuspendCanceled() event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos call Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/platform_app_launcher.cc
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index 54eb509409641bf74f5462b97ac1ab8ad686e33b..8c62a5680be8a191d6343cf44e3f4e25fcf99cf5 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -162,19 +162,9 @@ class PlatformAppCommandLineLauncher
// call back to us.
extensions::LazyBackgroundTaskQueue* queue =
ExtensionSystem::Get(profile_)->lazy_background_task_queue();
- if (queue->ShouldEnqueueTask(profile_, extension_)) {
- queue->AddPendingTask(profile_, extension_->id(), base::Bind(
- &PlatformAppCommandLineLauncher::GrantAccessToFileAndLaunch,
- this, file_path, mime_type));
- return;
- }
-
- ExtensionProcessManager* process_manager =
- ExtensionSystem::Get(profile_)->process_manager();
- ExtensionHost* host =
- process_manager->GetBackgroundHostForExtension(extension_->id());
- DCHECK(host);
- GrantAccessToFileAndLaunch(file_path, mime_type, host);
+ queue->AddPendingTask(profile_, extension_->id(), base::Bind(
+ &PlatformAppCommandLineLauncher::GrantAccessToFileAndLaunch,
+ this, file_path, mime_type));
}
void GrantAccessToFileAndLaunch(const FilePath& file_path,
@@ -250,19 +240,9 @@ class PlatformAppBlobIntentLauncher
// call back to us.
extensions::LazyBackgroundTaskQueue* queue =
ExtensionSystem::Get(profile_)->lazy_background_task_queue();
- if (queue->ShouldEnqueueTask(profile_, extension_)) {
- queue->AddPendingTask(profile_, extension_->id(), base::Bind(
- &PlatformAppBlobIntentLauncher::GrantAccessToFileAndLaunch,
- this));
- return;
- }
-
- ExtensionProcessManager* process_manager =
- ExtensionSystem::Get(profile_)->process_manager();
- ExtensionHost* host =
- process_manager->GetBackgroundHostForExtension(extension_->id());
- DCHECK(host);
- GrantAccessToFileAndLaunch(host);
+ queue->AddPendingTask(profile_, extension_->id(), base::Bind(
+ &PlatformAppBlobIntentLauncher::GrantAccessToFileAndLaunch,
+ this));
}
private:

Powered by Google App Engine
This is Rietveld 408576698