OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |