OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 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" |
| 13 #include "ui/app_list/app_list_item.h" |
| 14 |
| 15 namespace content { |
| 16 class BrowserContext; |
| 17 } // content |
| 18 |
| 19 // ArcAppItem represents an ARC app in app list. |
| 20 class ArcAppItem : public app_list::AppListItem, |
| 21 public ArcAppIcon::Observer { |
| 22 public: |
| 23 static const char kItemType[]; |
| 24 |
| 25 ArcAppItem(content::BrowserContext* context, |
| 26 const app_list::AppListSyncableService::SyncItem* sync_item, |
| 27 const std::string& id, |
| 28 const std::string& name, |
| 29 bool ready); |
| 30 ~ArcAppItem() override; |
| 31 |
| 32 void SetName(const std::string& name); |
| 33 |
| 34 void Activate(int event_flags) override; |
| 35 const char* GetItemType() const override; |
| 36 |
| 37 ArcAppIcon* arc_app_icon() { return arc_app_icon_.get(); } |
| 38 |
| 39 bool ready() const { return ready_; } |
| 40 |
| 41 void SetReady(bool ready); |
| 42 |
| 43 // ArcAppIcon::Observer |
| 44 void OnIconUpdated() override; |
| 45 |
| 46 private: |
| 47 // Updates the app item's icon, if necessary making it gray. |
| 48 void UpdateIcon(); |
| 49 |
| 50 content::BrowserContext* context_; |
| 51 bool ready_; |
| 52 scoped_ptr<ArcAppIcon> arc_app_icon_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); |
| 55 }; |
| 56 |
| 57 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ |
OLD | NEW |