| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNCABLE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 class Observer { | 68 class Observer { |
| 69 public: | 69 public: |
| 70 // Notifies that sync model was updated. | 70 // Notifies that sync model was updated. |
| 71 virtual void OnSyncModelUpdated() = 0; | 71 virtual void OnSyncModelUpdated() = 0; |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual ~Observer() = default; | 74 virtual ~Observer() = default; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 using SyncItemMap = std::map<std::string, SyncItem*>; | 77 using SyncItemMap = std::map<std::string, std::unique_ptr<SyncItem>>; |
| 78 | 78 |
| 79 // Populates the model when |extension_system| is ready. | 79 // Populates the model when |extension_system| is ready. |
| 80 AppListSyncableService(Profile* profile, | 80 AppListSyncableService(Profile* profile, |
| 81 extensions::ExtensionSystem* extension_system); | 81 extensions::ExtensionSystem* extension_system); |
| 82 | 82 |
| 83 ~AppListSyncableService() override; | 83 ~AppListSyncableService() override; |
| 84 | 84 |
| 85 // Adds |item| to |sync_items_| and |model_|. If a sync item already exists, | 85 // Adds |item| to |sync_items_| and |model_|. If a sync item already exists, |
| 86 // updates the existing sync item instead. | 86 // updates the existing sync item instead. |
| 87 void AddItem(std::unique_ptr<AppListItem> app_item); | 87 void AddItem(std::unique_ptr<AppListItem> app_item); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 // Provides integration with Drive apps. | 256 // Provides integration with Drive apps. |
| 257 std::unique_ptr<DriveAppProvider> drive_app_provider_; | 257 std::unique_ptr<DriveAppProvider> drive_app_provider_; |
| 258 | 258 |
| 259 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); | 259 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); |
| 260 }; | 260 }; |
| 261 | 261 |
| 262 } // namespace app_list | 262 } // namespace app_list |
| 263 | 263 |
| 264 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 264 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
| OLD | NEW |