| 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 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Sets uninstalled flag for default package if it exists in default packages | 66 // Sets uninstalled flag for default package if it exists in default packages |
| 67 // list. | 67 // list. |
| 68 void MaybeMarkPackageUninstalled(const std::string& package_name, | 68 void MaybeMarkPackageUninstalled(const std::string& package_name, |
| 69 bool uninstalled); | 69 bool uninstalled); |
| 70 | 70 |
| 71 // Returns set of packages which are marked not as uninstalled. | 71 // Returns set of packages which are marked not as uninstalled. |
| 72 std::unordered_set<std::string> GetActivePackages() const; | 72 std::unordered_set<std::string> GetActivePackages() const; |
| 73 | 73 |
| 74 const AppInfoMap& app_map() const { return apps_; } | 74 const AppInfoMap& app_map() const { return apps_; } |
| 75 | 75 |
| 76 // Marks default apps as hidden for user, for example in case Arc is managed | 76 // Marks default apps as hidden for user, for example in case ARC is managed |
| 77 // and disabled. | 77 // and disabled. |
| 78 void set_hidden(bool hidden) { hidden_ = hidden; } | 78 void set_hidden(bool hidden) { hidden_ = hidden; } |
| 79 bool is_hidden() const { return hidden_; } | 79 bool is_hidden() const { return hidden_; } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // Defines mapping package name to uninstalled state. | 82 // Defines mapping package name to uninstalled state. |
| 83 using PackageMap = std::map<std::string, bool>; | 83 using PackageMap = std::map<std::string, bool>; |
| 84 | 84 |
| 85 // Called when default apps are read. | 85 // Called when default apps are read. |
| 86 void OnAppsReady(std::unique_ptr<AppInfoMap> apps); | 86 void OnAppsReady(std::unique_ptr<AppInfoMap> apps); |
| 87 | 87 |
| 88 // Unowned pointer. | 88 // Unowned pointer. |
| 89 Delegate* const delegate_; | 89 Delegate* const delegate_; |
| 90 content::BrowserContext* const context_; | 90 content::BrowserContext* const context_; |
| 91 bool hidden_ = true; | 91 bool hidden_ = true; |
| 92 | 92 |
| 93 AppInfoMap apps_; | 93 AppInfoMap apps_; |
| 94 PackageMap packages_; | 94 PackageMap packages_; |
| 95 | 95 |
| 96 base::WeakPtrFactory<ArcDefaultAppList> weak_ptr_factory_; | 96 base::WeakPtrFactory<ArcDefaultAppList> weak_ptr_factory_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(ArcDefaultAppList); | 98 DISALLOW_COPY_AND_ASSIGN(ArcDefaultAppList); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ | 101 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_DEFAULT_APP_LIST_H_ |
| OLD | NEW |