| 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 "chrome/browser/apps/app_launch_for_metro_restart_win.h" | 5 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" |
| 6 | 6 |
| 7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 ExtensionSystem::Get(profile)->extension_service(); | 37 ExtensionSystem::Get(profile)->extension_service(); |
| 38 if (!extension_service) | 38 if (!extension_service) |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 const Extension* extension = | 41 const Extension* extension = |
| 42 extension_service->GetExtensionById(extension_id, false); | 42 extension_service->GetExtensionById(extension_id, false); |
| 43 if (!extension) | 43 if (!extension) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 AppRuntimeEventRouter::DispatchOnLaunchedEvent( | 46 AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
| 47 profile, extension, extensions::SOURCE_RESTART, nullptr); | 47 profile, extension, extensions::SOURCE_RESTART, |
| 48 std::unique_ptr<extensions::api::app_runtime::ActionData>()); |
| 48 } | 49 } |
| 49 | 50 |
| 50 } // namespace | 51 } // namespace |
| 51 | 52 |
| 52 void HandleAppLaunchForMetroRestart(Profile* profile) { | 53 void HandleAppLaunchForMetroRestart(Profile* profile) { |
| 53 PrefService* prefs = g_browser_process->local_state(); | 54 PrefService* prefs = g_browser_process->local_state(); |
| 54 if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestartProfile)) | 55 if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestartProfile)) |
| 55 return; | 56 return; |
| 56 | 57 |
| 57 // This will be called for each profile that had a browser window open before | 58 // This will be called for each profile that had a browser window open before |
| (...skipping 29 matching lines...) Expand all Loading... |
| 87 profile->GetPath().BaseName().MaybeAsASCII()); | 88 profile->GetPath().BaseName().MaybeAsASCII()); |
| 88 prefs->SetString(prefs::kAppLaunchForMetroRestart, extension_id); | 89 prefs->SetString(prefs::kAppLaunchForMetroRestart, extension_id); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void RegisterPrefs(PrefRegistrySimple* registry) { | 92 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 92 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); | 93 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); |
| 93 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); | 94 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace app_metro_launch | 97 } // namespace app_metro_launch |
| OLD | NEW |