Chromium Code Reviews| 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/app_load_service.h" | 5 #include "apps/app_load_service.h" |
| 6 | 6 |
| 7 #include "apps/app_load_service_factory.h" | 7 #include "apps/app_load_service_factory.h" |
| 8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
| 9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 // It is possible for an extension to be unloaded before it stops loading. | 92 // It is possible for an extension to be unloaded before it stops loading. |
| 93 if (!extension) | 93 if (!extension) |
| 94 return; | 94 return; |
| 95 std::map<std::string, PostReloadAction>::iterator it = | 95 std::map<std::string, PostReloadAction>::iterator it = |
| 96 post_reload_actions_.find(extension->id()); | 96 post_reload_actions_.find(extension->id()); |
| 97 if (it == post_reload_actions_.end()) | 97 if (it == post_reload_actions_.end()) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 switch (it->second.action_type) { | 100 switch (it->second.action_type) { |
| 101 case LAUNCH: | 101 case LAUNCH: |
| 102 LaunchPlatformApp(profile_, extension); | 102 LaunchPlatformAppWithSource( |
| 103 profile_, extension, extensions::SOURCE_RELOAD); | |
|
benwells
2014/10/21 03:51:57
This is unclear. Also, the source for LAUNCH_WITH_
cylee1
2014/10/21 13:41:16
To be honest I don't get the "case LAUNCH:" case
I
| |
| 103 break; | 104 break; |
| 104 case RESTART: | 105 case RESTART: |
| 105 RestartPlatformApp(profile_, extension); | 106 RestartPlatformApp(profile_, extension); |
| 106 break; | 107 break; |
| 107 case LAUNCH_WITH_COMMAND_LINE: | 108 case LAUNCH_WITH_COMMAND_LINE: |
| 108 LaunchPlatformAppWithCommandLine( | 109 LaunchPlatformAppWithCommandLine(profile_, |
| 109 profile_, extension, it->second.command_line, it->second.current_dir); | 110 extension, |
| 111 it->second.command_line, | |
| 112 it->second.current_dir, | |
| 113 extensions::SOURCE_RELOAD); | |
| 110 break; | 114 break; |
| 111 default: | 115 default: |
| 112 NOTREACHED(); | 116 NOTREACHED(); |
| 113 } | 117 } |
| 114 | 118 |
| 115 post_reload_actions_.erase(it); | 119 post_reload_actions_.erase(it); |
| 116 } | 120 } |
| 117 | 121 |
| 118 void AppLoadService::OnExtensionUnloaded( | 122 void AppLoadService::OnExtensionUnloaded( |
| 119 content::BrowserContext* browser_context, | 123 content::BrowserContext* browser_context, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 140 Extension::DISABLE_RELOAD) != 0; | 144 Extension::DISABLE_RELOAD) != 0; |
| 141 } | 145 } |
| 142 return false; | 146 return false; |
| 143 } | 147 } |
| 144 | 148 |
| 145 bool AppLoadService::HasPostReloadAction(const std::string& extension_id) { | 149 bool AppLoadService::HasPostReloadAction(const std::string& extension_id) { |
| 146 return post_reload_actions_.find(extension_id) != post_reload_actions_.end(); | 150 return post_reload_actions_.find(extension_id) != post_reload_actions_.end(); |
| 147 } | 151 } |
| 148 | 152 |
| 149 } // namespace apps | 153 } // namespace apps |
| OLD | NEW |