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

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

Issue 2507073002: Split ArcSessionManager from ArcAuthService. (Closed)
Patch Set: Fix rebase mistake Created 4 years, 1 month 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 bool LauncherControllerHelper::IsValidIDForCurrentUser( 146 bool LauncherControllerHelper::IsValidIDForCurrentUser(
147 const std::string& id) const { 147 const std::string& id) const {
148 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); 148 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs();
149 if (arc_prefs && arc_prefs->IsRegistered(id)) 149 if (arc_prefs && arc_prefs->IsRegistered(id))
150 return true; 150 return true;
151 if (!GetExtensionByID(profile_, id)) 151 if (!GetExtensionByID(profile_, id))
152 return false; 152 return false;
153 if (id == ArcSupportHost::kHostAppId) { 153 if (id == ArcSupportHost::kHostAppId) {
154 if (!arc::ArcAuthService::IsAllowedForProfile(profile())) 154 if (!arc::ArcSessionManager::IsAllowedForProfile(profile()))
155 return false; 155 return false;
156 const arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get(); 156 const arc::ArcSessionManager* arc_session_manager =
157 DCHECK(arc_auth_service); 157 arc::ArcSessionManager::Get();
158 if (!arc_auth_service->IsAllowed()) 158 DCHECK(arc_session_manager);
159 if (!arc_session_manager->IsAllowed())
159 return false; 160 return false;
160 if (!arc_auth_service->IsArcEnabled() && arc_auth_service->IsArcManaged()) 161 if (!arc_session_manager->IsArcEnabled() &&
162 arc_session_manager->IsArcManaged())
161 return false; 163 return false;
162 } 164 }
163 165
164 return true; 166 return true;
165 } 167 }
166 168
167 void LauncherControllerHelper::LaunchApp(const std::string& app_id, 169 void LauncherControllerHelper::LaunchApp(const std::string& app_id,
168 ash::LaunchSource source, 170 ash::LaunchSource source,
169 int event_flags) { 171 int event_flags) {
170 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); 172 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 214
213 void LauncherControllerHelper::ExtensionEnableFlowFinished() { 215 void LauncherControllerHelper::ExtensionEnableFlowFinished() {
214 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, 216 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN,
215 ui::EF_NONE); 217 ui::EF_NONE);
216 extension_enable_flow_.reset(); 218 extension_enable_flow_.reset();
217 } 219 }
218 220
219 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { 221 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) {
220 extension_enable_flow_.reset(); 222 extension_enable_flow_.reset();
221 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698