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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 276 } |
277 | 277 |
278 void GrantAccessToFileAndLaunch(const std::string& mime_type, | 278 void GrantAccessToFileAndLaunch(const std::string& mime_type, |
279 ExtensionHost* host) { | 279 ExtensionHost* host) { |
280 // If there was an error loading the app page, |host| will be NULL. | 280 // If there was an error loading the app page, |host| will be NULL. |
281 if (!host) { | 281 if (!host) { |
282 LOG(ERROR) << "Could not load app page for " << extension_->id(); | 282 LOG(ERROR) << "Could not load app page for " << extension_->id(); |
283 return; | 283 return; |
284 } | 284 } |
285 | 285 |
286 GrantedFileEntry file_entry = CreateFileEntry( | 286 GrantedFileEntry file_entry = |
287 profile_, extension_, host->render_process_host()->GetID(), file_path_); | 287 CreateFileEntry(profile_, |
| 288 extension_, |
| 289 host->render_process_host()->GetID(), |
| 290 file_path_, |
| 291 false); |
288 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( | 292 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( |
289 profile_, extension_, handler_id_, mime_type, file_entry); | 293 profile_, extension_, handler_id_, mime_type, file_entry); |
290 } | 294 } |
291 | 295 |
292 // The profile the app should be run in. | 296 // The profile the app should be run in. |
293 Profile* profile_; | 297 Profile* profile_; |
294 // The extension providing the app. | 298 // The extension providing the app. |
295 const Extension* extension_; | 299 const Extension* extension_; |
296 // The path to be passed through to the app. | 300 // The path to be passed through to the app. |
297 const base::FilePath file_path_; | 301 const base::FilePath file_path_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 extension_prefs->SetIsActive(extension->id(), false); | 380 extension_prefs->SetIsActive(extension->id(), false); |
377 bool listening_to_launch = event_router-> | 381 bool listening_to_launch = event_router-> |
378 ExtensionHasEventListener(extension->id(), | 382 ExtensionHasEventListener(extension->id(), |
379 app_runtime::OnLaunched::kEventName); | 383 app_runtime::OnLaunched::kEventName); |
380 | 384 |
381 if (listening_to_launch && had_windows) | 385 if (listening_to_launch && had_windows) |
382 LaunchPlatformAppWithNoData(profile, extension); | 386 LaunchPlatformAppWithNoData(profile, extension); |
383 } | 387 } |
384 | 388 |
385 } // namespace apps | 389 } // namespace apps |
OLD | NEW |