| 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, | 47 profile, extension, extensions::SOURCE_RESTART, nullptr); |
| 48 std::unique_ptr<extensions::api::app_runtime::ActionData>()); | |
| 49 } | 48 } |
| 50 | 49 |
| 51 } // namespace | 50 } // namespace |
| 52 | 51 |
| 53 void HandleAppLaunchForMetroRestart(Profile* profile) { | 52 void HandleAppLaunchForMetroRestart(Profile* profile) { |
| 54 PrefService* prefs = g_browser_process->local_state(); | 53 PrefService* prefs = g_browser_process->local_state(); |
| 55 if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestartProfile)) | 54 if (!prefs->HasPrefPath(prefs::kAppLaunchForMetroRestartProfile)) |
| 56 return; | 55 return; |
| 57 | 56 |
| 58 // This will be called for each profile that had a browser window open before | 57 // This will be called for each profile that had a browser window open before |
| (...skipping 29 matching lines...) Expand all Loading... |
| 88 profile->GetPath().BaseName().MaybeAsASCII()); | 87 profile->GetPath().BaseName().MaybeAsASCII()); |
| 89 prefs->SetString(prefs::kAppLaunchForMetroRestart, extension_id); | 88 prefs->SetString(prefs::kAppLaunchForMetroRestart, extension_id); |
| 90 } | 89 } |
| 91 | 90 |
| 92 void RegisterPrefs(PrefRegistrySimple* registry) { | 91 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 93 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); | 92 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); |
| 94 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); | 93 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace app_metro_launch | 96 } // namespace app_metro_launch |
| OLD | NEW |