OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_model_builder.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 8 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/app_list/arc/arc_app_item.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_item.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const std::string& app_id, | 49 const std::string& app_id, |
50 const ArcAppListPrefs::AppInfo& app_info) { | 50 const ArcAppListPrefs::AppInfo& app_info) { |
51 if (app_info.showInLauncher) | 51 if (app_info.showInLauncher) |
52 InsertApp(CreateApp(app_id, app_info)); | 52 InsertApp(CreateApp(app_id, app_info)); |
53 } | 53 } |
54 | 54 |
55 void ArcAppModelBuilder::OnAppRemoved(const std::string& app_id) { | 55 void ArcAppModelBuilder::OnAppRemoved(const std::string& app_id) { |
56 const arc::ArcSessionManager* arc_session_manager = | 56 const arc::ArcSessionManager* arc_session_manager = |
57 arc::ArcSessionManager::Get(); | 57 arc::ArcSessionManager::Get(); |
58 DCHECK(arc_session_manager); | 58 DCHECK(arc_session_manager); |
59 // Don't sync app removal in case it was caused by disabling Arc. | 59 // Don't sync app removal in case it was caused by disabling ARC. |
60 const bool unsynced_change = !arc_session_manager->IsArcPlayStoreEnabled(); | 60 const bool unsynced_change = !arc_session_manager->IsArcPlayStoreEnabled(); |
61 RemoveApp(app_id, unsynced_change); | 61 RemoveApp(app_id, unsynced_change); |
62 } | 62 } |
63 | 63 |
64 void ArcAppModelBuilder::OnAppIconUpdated(const std::string& app_id, | 64 void ArcAppModelBuilder::OnAppIconUpdated(const std::string& app_id, |
65 ui::ScaleFactor scale_factor) { | 65 ui::ScaleFactor scale_factor) { |
66 ArcAppItem* app_item = GetArcAppItem(app_id); | 66 ArcAppItem* app_item = GetArcAppItem(app_id); |
67 if (!app_item) { | 67 if (!app_item) { |
68 VLOG(2) << "Could not update the icon of ARC app(" << app_id | 68 VLOG(2) << "Could not update the icon of ARC app(" << app_id |
69 << ") because it was not found."; | 69 << ") because it was not found."; |
(...skipping 16 matching lines...) Expand all Loading... |
86 app_item->SetName(name); | 86 app_item->SetName(name); |
87 } | 87 } |
88 | 88 |
89 void ArcAppModelBuilder::OnListItemMoved(size_t from_index, | 89 void ArcAppModelBuilder::OnListItemMoved(size_t from_index, |
90 size_t to_index, | 90 size_t to_index, |
91 app_list::AppListItem* item) { | 91 app_list::AppListItem* item) { |
92 // On ChromeOS we expect that ArcAppModelBuilder is initialized with | 92 // On ChromeOS we expect that ArcAppModelBuilder is initialized with |
93 // AppListSyncableService and in this case this observer is not used. | 93 // AppListSyncableService and in this case this observer is not used. |
94 NOTREACHED(); | 94 NOTREACHED(); |
95 } | 95 } |
OLD | NEW |