| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void LauncherControllerHelper::LaunchApp(const std::string& app_id, | 169 void LauncherControllerHelper::LaunchApp(const std::string& app_id, |
| 170 ash::LaunchSource source, | 170 ash::LaunchSource source, |
| 171 int event_flags) { | 171 int event_flags) { |
| 172 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); | 172 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); |
| 173 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { | 173 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { |
| 174 arc::LaunchApp(profile_, app_id); | 174 arc::LaunchApp(profile_, app_id, event_flags); |
| 175 return; | 175 return; |
| 176 } | 176 } |
| 177 | 177 |
| 178 // |extension| could be null when it is being unloaded for updating. | 178 // |extension| could be null when it is being unloaded for updating. |
| 179 const extensions::Extension* extension = GetExtensionByID(profile_, app_id); | 179 const extensions::Extension* extension = GetExtensionByID(profile_, app_id); |
| 180 if (!extension) | 180 if (!extension) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile_)) { | 183 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile_)) { |
| 184 // Do nothing if there is already a running enable flow. | 184 // Do nothing if there is already a running enable flow. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 214 | 214 |
| 215 void LauncherControllerHelper::ExtensionEnableFlowFinished() { | 215 void LauncherControllerHelper::ExtensionEnableFlowFinished() { |
| 216 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, | 216 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, |
| 217 ui::EF_NONE); | 217 ui::EF_NONE); |
| 218 extension_enable_flow_.reset(); | 218 extension_enable_flow_.reset(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { | 221 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { |
| 222 extension_enable_flow_.reset(); | 222 extension_enable_flow_.reset(); |
| 223 } | 223 } |
| OLD | NEW |