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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_utils.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/app_list/arc/arc_app_utils.h" 5 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 bool LaunchApp(content::BrowserContext* context, const std::string& app_id) { 214 bool LaunchApp(content::BrowserContext* context, const std::string& app_id) {
215 return LaunchApp(context, app_id, true); 215 return LaunchApp(context, app_id, true);
216 } 216 }
217 217
218 bool LaunchApp(content::BrowserContext* context, 218 bool LaunchApp(content::BrowserContext* context,
219 const std::string& app_id, 219 const std::string& app_id,
220 bool landscape_layout) { 220 bool landscape_layout) {
221 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); 221 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context);
222 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); 222 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id);
223 if (app_info && !app_info->ready) { 223 if (app_info && !app_info->ready) {
224 ArcAuthService* auth_service = ArcAuthService::Get(); 224 ArcSessionManager* arc_session_manager = ArcSessionManager::Get();
225 DCHECK(auth_service); 225 DCHECK(arc_session_manager);
226 226
227 bool arc_activated = false; 227 bool arc_activated = false;
228 if (!auth_service->IsArcEnabled()) { 228 if (!arc_session_manager->IsArcEnabled()) {
229 if (!prefs->IsDefault(app_id)) { 229 if (!prefs->IsDefault(app_id)) {
230 NOTREACHED(); 230 NOTREACHED();
231 return false; 231 return false;
232 } 232 }
233 233
234 auth_service->EnableArc(); 234 arc_session_manager->EnableArc();
235 if (!auth_service->IsArcEnabled()) { 235 if (!arc_session_manager->IsArcEnabled()) {
236 NOTREACHED(); 236 NOTREACHED();
237 return false; 237 return false;
238 } 238 }
239 arc_activated = true; 239 arc_activated = true;
240 } 240 }
241 241
242 // PlayStore item has special handling for shelf controllers. In order to 242 // PlayStore item has special handling for shelf controllers. In order to
243 // avoid unwanted initial animation for PlayStore item do not create 243 // avoid unwanted initial animation for PlayStore item do not create
244 // deferred launch request when PlayStore item enables Arc. 244 // deferred launch request when PlayStore item enables Arc.
245 if (!arc_activated || app_id != kPlayStoreAppId) { 245 if (!arc_activated || app_id != kPlayStoreAppId) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 if (!app_instance) 373 if (!app_instance)
374 return false; 374 return false;
375 375
376 app_instance->ShowPackageInfoOnPage( 376 app_instance->ShowPackageInfoOnPage(
377 package_name, page, 377 package_name, page,
378 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); 378 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height)));
379 return true; 379 return true;
380 } 380 }
381 381
382 } // namespace arc 382 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698