| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSION_APP_MODEL_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "chrome/browser/extensions/install_observer.h" | 12 #include "chrome/browser/extensions/install_observer.h" |
| 13 #include "ui/app_list/app_list_model.h" | 13 #include "ui/app_list/app_list_model.h" |
| 14 #include "ui/base/models/list_model_observer.h" | 14 #include "ui/base/models/list_model_observer.h" |
| 15 | 15 |
| 16 class AppListControllerDelegate; | 16 class AppListControllerDelegate; |
| 17 class ExtensionAppItem; | 17 class ExtensionAppItem; |
| 18 class ExtensionSet; | |
| 19 class Profile; | 18 class Profile; |
| 20 | 19 |
| 21 namespace extensions { | 20 namespace extensions { |
| 22 class Extension; | 21 class Extension; |
| 22 class ExtensionSet; |
| 23 class InstallTracker; | 23 class InstallTracker; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace gfx { | 26 namespace gfx { |
| 27 class ImageSkia; | 27 class ImageSkia; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // This class populates and maintains the given |model| with information from | 30 // This class populates and maintains the given |model| with information from |
| 31 // |profile|. | 31 // |profile|. |
| 32 class ExtensionAppModelBuilder : public extensions::InstallObserver, | 32 class ExtensionAppModelBuilder : public extensions::InstallObserver, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 61 virtual void OnAppInstalledToAppList( | 61 virtual void OnAppInstalledToAppList( |
| 62 const std::string& extension_id) OVERRIDE; | 62 const std::string& extension_id) OVERRIDE; |
| 63 virtual void OnShutdown() OVERRIDE; | 63 virtual void OnShutdown() OVERRIDE; |
| 64 | 64 |
| 65 // AppListItemListObserver | 65 // AppListItemListObserver |
| 66 virtual void OnListItemMoved(size_t from_index, | 66 virtual void OnListItemMoved(size_t from_index, |
| 67 size_t to_index, | 67 size_t to_index, |
| 68 app_list::AppListItemModel* item) OVERRIDE; | 68 app_list::AppListItemModel* item) OVERRIDE; |
| 69 | 69 |
| 70 // Adds apps in |extensions| to |apps|. | 70 // Adds apps in |extensions| to |apps|. |
| 71 void AddApps(const ExtensionSet* extensions, ExtensionAppList* apps); | 71 void AddApps(const extensions::ExtensionSet* extensions, |
| 72 ExtensionAppList* apps); |
| 72 | 73 |
| 73 // Populates the model with apps. | 74 // Populates the model with apps. |
| 74 void PopulateApps(); | 75 void PopulateApps(); |
| 75 | 76 |
| 76 // Re-sort apps in case app ordinal prefs are changed. | 77 // Re-sort apps in case app ordinal prefs are changed. |
| 77 void ResortApps(); | 78 void ResortApps(); |
| 78 | 79 |
| 79 // Inserts an app based on app ordinal prefs. | 80 // Inserts an app based on app ordinal prefs. |
| 80 void InsertApp(ExtensionAppItem* app); | 81 void InsertApp(ExtensionAppItem* app); |
| 81 | 82 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 106 // if we try to highlight an app that doesn't exist in the list yet. | 107 // if we try to highlight an app that doesn't exist in the list yet. |
| 107 bool highlighted_app_pending_; | 108 bool highlighted_app_pending_; |
| 108 | 109 |
| 109 // We listen to this to show app installing progress. | 110 // We listen to this to show app installing progress. |
| 110 extensions::InstallTracker* tracker_; | 111 extensions::InstallTracker* tracker_; |
| 111 | 112 |
| 112 DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); | 113 DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ | 116 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| OLD | NEW |