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

Side by Side Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 14348015: Send onLaunched to apps that don't listen to onRestarted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/event_names.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/platform_app_launcher.h" 5 #include "chrome/browser/extensions/platform_app_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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" 14 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
15 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" 15 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
16 #include "chrome/browser/extensions/api/file_system/file_system_api.h" 16 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
17 #include "chrome/browser/extensions/event_names.h"
18 #include "chrome/browser/extensions/event_router.h"
17 #include "chrome/browser/extensions/extension_host.h" 19 #include "chrome/browser/extensions/extension_host.h"
18 #include "chrome/browser/extensions/extension_prefs.h" 20 #include "chrome/browser/extensions/extension_prefs.h"
19 #include "chrome/browser/extensions/extension_process_manager.h" 21 #include "chrome/browser/extensions/extension_process_manager.h"
20 #include "chrome/browser/extensions/extension_service.h" 22 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/extension_system.h" 23 #include "chrome/browser/extensions/extension_system.h"
22 #include "chrome/browser/extensions/lazy_background_task_queue.h" 24 #include "chrome/browser/extensions/lazy_background_task_queue.h"
23 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h" 26 #include "chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h"
25 #include "chrome/common/extensions/extension.h" 27 #include "chrome/common/extensions/extension.h"
26 #include "chrome/common/extensions/extension_messages.h" 28 #include "chrome/common/extensions/extension_messages.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 const base::FilePath& file_path) { 410 const base::FilePath& file_path) {
409 scoped_refptr<PlatformAppPathLauncher> launcher = 411 scoped_refptr<PlatformAppPathLauncher> launcher =
410 new PlatformAppPathLauncher(profile, extension, file_path); 412 new PlatformAppPathLauncher(profile, extension, file_path);
411 launcher->LaunchWithHandler(handler_id); 413 launcher->LaunchWithHandler(handler_id);
412 } 414 }
413 415
414 void RestartPlatformAppWithFileEntries( 416 void RestartPlatformAppWithFileEntries(
415 Profile* profile, 417 Profile* profile,
416 const Extension* extension, 418 const Extension* extension,
417 const std::vector<SavedFileEntry>& file_entries) { 419 const std::vector<SavedFileEntry>& file_entries) {
418 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher( 420 bool listening_to_restart = ExtensionSystem::Get(profile)->event_router()->
419 profile, extension, file_entries); 421 ExtensionHasEventListener(extension->id(),
420 launcher->Launch(); 422 event_names::kOnRestarted);
423
424 if (listening_to_restart) {
425 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher(
426 profile, extension, file_entries);
427 launcher->Launch();
428 } else {
429 LaunchPlatformAppWithNoData(profile, extension);
430 }
421 } 431 }
422 432
423 } // namespace extensions 433 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/event_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698