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

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

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Address comments. Created 4 years, 2 months 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 DCHECK(arc_auth_service); 157 DCHECK(arc_auth_service);
158 if (!arc_auth_service->IsAllowed()) 158 if (!arc_auth_service->IsAllowed())
159 return false; 159 return false;
160 if (!arc_auth_service->IsArcEnabled() && arc_auth_service->IsArcManaged()) 160 if (!arc_auth_service->IsArcEnabled() && arc_auth_service->IsArcManaged())
161 return false; 161 return false;
162 } 162 }
163 163
164 return true; 164 return true;
165 } 165 }
166 166
167 void LauncherControllerHelper::SetCurrentUser(Profile* profile) {
168 profile_ = profile;
169 }
170
171 void LauncherControllerHelper::LaunchApp(const std::string& app_id, 167 void LauncherControllerHelper::LaunchApp(const std::string& app_id,
172 ash::LaunchSource source, 168 ash::LaunchSource source,
173 int event_flags) { 169 int event_flags) {
174 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); 170 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs();
175 if (arc_prefs && arc_prefs->IsRegistered(app_id)) { 171 if (arc_prefs && arc_prefs->IsRegistered(app_id)) {
176 arc::LaunchApp(profile_, app_id); 172 arc::LaunchApp(profile_, app_id);
177 return; 173 return;
178 } 174 }
179 175
180 // |extension| could be null when it is being unloaded for updating. 176 // |extension| could be null when it is being unloaded for updating.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 212
217 void LauncherControllerHelper::ExtensionEnableFlowFinished() { 213 void LauncherControllerHelper::ExtensionEnableFlowFinished() {
218 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, 214 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN,
219 ui::EF_NONE); 215 ui::EF_NONE);
220 extension_enable_flow_.reset(); 216 extension_enable_flow_.reset();
221 } 217 }
222 218
223 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { 219 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) {
224 extension_enable_flow_.reset(); 220 extension_enable_flow_.reset();
225 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698