Chromium Code Reviews| 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_ARC_ARC_APP_ITEM_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | |
| 12 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" | 11 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" |
| 12 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" | |
| 13 #include "ui/app_list/app_list_item.h" | 13 #include "ui/app_list/app_list_item.h" |
| 14 | 14 |
| 15 namespace content { | 15 class AppListControllerDelegate; |
|
xiyuan
2015/12/10 05:21:13
nit: seems not needed.
khmel1
2015/12/10 09:07:31
Yes, no longer used here
| |
| 16 class BrowserContext; | 16 class Profile; |
| 17 } // content | |
| 18 | 17 |
| 19 // ArcAppItem represents an ARC app in app list. | 18 // ArcAppItem represents an ARC app in app list. |
| 20 class ArcAppItem : public app_list::AppListItem, | 19 class ArcAppItem : public ChromeAppListItem, |
| 21 public ArcAppIcon::Observer { | 20 public ArcAppIcon::Observer { |
| 22 public: | 21 public: |
| 23 static const char kItemType[]; | 22 static const char kItemType[]; |
| 24 | 23 |
| 25 ArcAppItem(content::BrowserContext* context, | 24 ArcAppItem(Profile* profile, |
| 26 const app_list::AppListSyncableService::SyncItem* sync_item, | 25 const app_list::AppListSyncableService::SyncItem* sync_item, |
| 27 const std::string& id, | 26 const std::string& id, |
| 28 const std::string& name, | 27 const std::string& name, |
| 29 bool ready); | 28 bool ready); |
| 30 ~ArcAppItem() override; | 29 ~ArcAppItem() override; |
| 31 | 30 |
| 32 void SetName(const std::string& name); | 31 void SetName(const std::string& name); |
| 33 | 32 |
| 34 void Activate(int event_flags) override; | 33 void Activate(int event_flags) override; |
| 35 const char* GetItemType() const override; | 34 const char* GetItemType() const override; |
| 36 | 35 |
| 37 ArcAppIcon* arc_app_icon() { return arc_app_icon_.get(); } | 36 ArcAppIcon* arc_app_icon() { return arc_app_icon_.get(); } |
| 38 | 37 |
| 39 bool ready() const { return ready_; } | 38 bool ready() const { return ready_; } |
| 40 | 39 |
| 41 void SetReady(bool ready); | 40 void SetReady(bool ready); |
| 42 | 41 |
| 43 // ArcAppIcon::Observer | 42 // ArcAppIcon::Observer |
| 44 void OnIconUpdated() override; | 43 void OnIconUpdated() override; |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 // Updates the app item's icon, if necessary making it gray. | 46 // Updates the app item's icon, if necessary making it gray. |
| 48 void UpdateIcon(); | 47 void UpdateIcon(); |
| 49 | 48 |
| 50 content::BrowserContext* context_; | |
| 51 bool ready_; | 49 bool ready_; |
| 52 scoped_ptr<ArcAppIcon> arc_app_icon_; | 50 scoped_ptr<ArcAppIcon> arc_app_icon_; |
| 53 | 51 |
| 54 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); | 52 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ | 55 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
| OLD | NEW |