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 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 app_list::AppListSyncableService* service() { return service_; } | 41 app_list::AppListSyncableService* service() { return service_; } |
42 | 42 |
43 Profile* profile() { return profile_; } | 43 Profile* profile() { return profile_; } |
44 | 44 |
45 AppListControllerDelegate* controller() { return controller_; } | 45 AppListControllerDelegate* controller() { return controller_; } |
46 | 46 |
47 app_list::AppListModel* model() { return model_; } | 47 app_list::AppListModel* model() { return model_; } |
48 | 48 |
49 // Inserts an app based on app ordinal prefs. | 49 // Inserts an app based on app ordinal prefs. |
50 void InsertApp(scoped_ptr<app_list::AppListItem> app); | 50 void InsertApp(std::unique_ptr<app_list::AppListItem> app); |
51 | 51 |
52 // Removes an app based on app id. | 52 // Removes an app based on app id. |
53 void RemoveApp(const std::string& id); | 53 void RemoveApp(const std::string& id); |
54 | 54 |
55 const app_list::AppListSyncableService::SyncItem* GetSyncItem( | 55 const app_list::AppListSyncableService::SyncItem* GetSyncItem( |
56 const std::string& id); | 56 const std::string& id); |
57 | 57 |
58 // Returns app instance matching |id| or nullptr. | 58 // Returns app instance matching |id| or nullptr. |
59 app_list::AppListItem* GetAppItem(const std::string& id); | 59 app_list::AppListItem* GetAppItem(const std::string& id); |
60 | 60 |
61 private: | 61 private: |
62 // Unowned pointers to the service that owns this and associated profile. | 62 // Unowned pointers to the service that owns this and associated profile. |
63 app_list::AppListSyncableService* service_ = nullptr; | 63 app_list::AppListSyncableService* service_ = nullptr; |
64 Profile* profile_ = nullptr; | 64 Profile* profile_ = nullptr; |
65 | 65 |
66 // Unowned pointer to the app list model. | 66 // Unowned pointer to the app list model. |
67 app_list::AppListModel* model_ = nullptr; | 67 app_list::AppListModel* model_ = nullptr; |
68 | 68 |
69 // Unowned pointer to the app list controller. | 69 // Unowned pointer to the app list controller. |
70 AppListControllerDelegate* controller_; | 70 AppListControllerDelegate* controller_; |
71 | 71 |
72 // Global constant defined for each item type. | 72 // Global constant defined for each item type. |
73 const char* item_type_; | 73 const char* item_type_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(AppListModelBuilder); | 75 DISALLOW_COPY_AND_ASSIGN(AppListModelBuilder); |
76 }; | 76 }; |
77 | 77 |
78 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ | 78 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_MODEL_BUILDER_H_ |
OLD | NEW |