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

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

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

Powered by Google App Engine
This is Rietveld 408576698