Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_controller_helper.cc

Issue 2550683002: [Merge to 2924] Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 return true; 164 return true;
165 } 165 }
166 166
167 void LauncherControllerHelper::LaunchApp(const std::string& app_id, 167 void LauncherControllerHelper::LaunchApp(const std::string& app_id,
168 ash::LaunchSource source, 168 ash::LaunchSource source,
169 int event_flags) { 169 int event_flags) {
170 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); 170 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs();
171 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { 171 if (arc_prefs && arc_prefs->IsRegistered(app_id)) {
172 arc::LaunchApp(profile_, app_id); 172 arc::LaunchApp(profile_, app_id, event_flags);
173 return; 173 return;
174 } 174 }
175 175
176 // |extension| could be null when it is being unloaded for updating. 176 // |extension| could be null when it is being unloaded for updating.
177 const extensions::Extension* extension = GetExtensionByID(profile_, app_id); 177 const extensions::Extension* extension = GetExtensionByID(profile_, app_id);
178 if (!extension) 178 if (!extension)
179 return; 179 return;
180 180
181 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile_)) { 181 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile_)) {
182 // Do nothing if there is already a running enable flow. 182 // Do nothing if there is already a running enable flow.
(...skipping 29 matching lines...) Expand all
212 212
213 void LauncherControllerHelper::ExtensionEnableFlowFinished() { 213 void LauncherControllerHelper::ExtensionEnableFlowFinished() {
214 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, 214 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN,
215 ui::EF_NONE); 215 ui::EF_NONE);
216 extension_enable_flow_.reset(); 216 extension_enable_flow_.reset();
217 } 217 }
218 218
219 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { 219 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) {
220 extension_enable_flow_.reset(); 220 extension_enable_flow_.reset();
221 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698