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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_utils.cc

Issue 2707133006: Start ARC and sign in after Chrome OS login (Closed)
Patch Set: Created 3 years, 10 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 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 const std::string& app_id, 262 const std::string& app_id,
263 bool landscape_layout, 263 bool landscape_layout,
264 int event_flags) { 264 int event_flags) {
265 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); 265 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context);
266 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); 266 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id);
267 if (app_info && !app_info->ready) { 267 if (app_info && !app_info->ready) {
268 ArcSessionManager* arc_session_manager = ArcSessionManager::Get(); 268 ArcSessionManager* arc_session_manager = ArcSessionManager::Get();
269 DCHECK(arc_session_manager); 269 DCHECK(arc_session_manager);
270 270
271 bool arc_activated = false; 271 bool arc_activated = false;
272 if (!arc_session_manager->IsArcPlayStoreEnabled()) { 272 if (arc_session_manager->IsPersistentArc()) {
hidehiko 2017/02/23 10:29:16 If Play Store is not yet enabled, I think it is st
hidehiko 2017/02/23 10:29:16 nit: Could you elide the brace?
victorhsieh 2017/02/24 00:45:00 Right. There won't be apps from Play Store in opt
victorhsieh 2017/02/25 00:21:33 Seems like there is an unlikely edge case when app
273 arc_activated = true;
274 }
275
276 if (!arc_activated && !arc_session_manager->IsArcPlayStoreEnabled()) {
273 if (!prefs->IsDefault(app_id)) { 277 if (!prefs->IsDefault(app_id)) {
274 NOTREACHED(); 278 NOTREACHED();
275 return false; 279 return false;
276 } 280 }
277 281
278 arc_session_manager->SetArcPlayStoreEnabled(true); 282 arc_session_manager->SetArcPlayStoreEnabled(true);
279 if (!arc_session_manager->IsArcPlayStoreEnabled()) { 283 if (!arc_session_manager->IsArcPlayStoreEnabled()) {
280 NOTREACHED(); 284 NOTREACHED();
281 return false; 285 return false;
282 } 286 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 return false; 439 return false;
436 440
437 const ArcAppListPrefs* const arc_prefs = ArcAppListPrefs::Get(context); 441 const ArcAppListPrefs* const arc_prefs = ArcAppListPrefs::Get(context);
438 if (!arc_prefs) 442 if (!arc_prefs)
439 return false; 443 return false;
440 444
441 return arc_prefs->IsRegistered(ArcAppShelfId::FromString(id).app_id()); 445 return arc_prefs->IsRegistered(ArcAppShelfId::FromString(id).app_id());
442 } 446 }
443 447
444 } // namespace arc 448 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698