| OLD | NEW |
| 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/ui/ash/launcher/launcher_controller_helper.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 return false; | 163 return false; |
| 164 if (!arc_session_manager->IsArcEnabled() && | 164 if (!arc_session_manager->IsArcEnabled() && |
| 165 arc_session_manager->IsArcManaged()) | 165 arc_session_manager->IsArcManaged()) |
| 166 return false; | 166 return false; |
| 167 } | 167 } |
| 168 | 168 |
| 169 return true; | 169 return true; |
| 170 } | 170 } |
| 171 | 171 |
| 172 void LauncherControllerHelper::LaunchApp(const std::string& app_id, | 172 void LauncherControllerHelper::LaunchApp(const std::string& app_id, |
| 173 const std::string& launch_id, |
| 173 ash::LaunchSource source, | 174 ash::LaunchSource source, |
| 174 int event_flags) { | 175 int event_flags) { |
| 175 LaunchAppWithLaunchId(app_id, "", source, event_flags); | |
| 176 } | |
| 177 | |
| 178 void LauncherControllerHelper::LaunchAppWithLaunchId( | |
| 179 const std::string& app_id, | |
| 180 const std::string& launch_id, | |
| 181 ash::LaunchSource source, | |
| 182 int event_flags) { | |
| 183 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); | 176 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); |
| 184 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { | 177 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { |
| 185 arc::LaunchApp(profile_, app_id, event_flags); | 178 arc::LaunchApp(profile_, app_id, event_flags); |
| 186 return; | 179 return; |
| 187 } | 180 } |
| 188 | 181 |
| 189 // |extension| could be null when it is being unloaded for updating. | 182 // |extension| could be null when it is being unloaded for updating. |
| 190 const extensions::Extension* extension = GetExtensionByID(profile_, app_id); | 183 const extensions::Extension* extension = GetExtensionByID(profile_, app_id); |
| 191 if (!extension) | 184 if (!extension) |
| 192 return; | 185 return; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 218 params.launch_id = launch_id; | 211 params.launch_id = launch_id; |
| 219 | 212 |
| 220 OpenApplication(params); | 213 OpenApplication(params); |
| 221 } | 214 } |
| 222 | 215 |
| 223 ArcAppListPrefs* LauncherControllerHelper::GetArcAppListPrefs() const { | 216 ArcAppListPrefs* LauncherControllerHelper::GetArcAppListPrefs() const { |
| 224 return ArcAppListPrefs::Get(profile_); | 217 return ArcAppListPrefs::Get(profile_); |
| 225 } | 218 } |
| 226 | 219 |
| 227 void LauncherControllerHelper::ExtensionEnableFlowFinished() { | 220 void LauncherControllerHelper::ExtensionEnableFlowFinished() { |
| 228 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, | 221 LaunchApp(extension_enable_flow_->extension_id(), std::string(), |
| 229 ui::EF_NONE); | 222 ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE); |
| 230 extension_enable_flow_.reset(); | 223 extension_enable_flow_.reset(); |
| 231 } | 224 } |
| 232 | 225 |
| 233 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { | 226 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { |
| 234 extension_enable_flow_.reset(); | 227 extension_enable_flow_.reset(); |
| 235 } | 228 } |
| OLD | NEW |