Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
|
Luis Héctor Chávez
2015/11/12 20:49:16
"(c)" should not be used. `git cl format` _might_
khmel1
2015/11/13 15:00:56
Good catch. I was looking to extension_app_item wh
| |
| 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_APP_ITEM_H_ | |
| 6 #define CHROME_BROWSER_UI_APP_LIST_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_app_icon.h" | |
| 13 #include "ui/app_list/app_list_item.h" | |
| 14 | |
| 15 namespace content { | |
| 16 class BrowserContext; | |
| 17 } | |
| 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 void SetReady(bool ready); | |
| 40 | |
| 41 // ArcAppIcon::Observer | |
| 42 void OnIconUpdated() override; | |
| 43 | |
| 44 private: | |
| 45 // Updates the app item's icon, if necessary making it gray. | |
| 46 void UpdateIcon(); | |
| 47 | |
| 48 content::BrowserContext* context_; | |
| 49 bool ready_; | |
| 50 scoped_ptr<ArcAppIcon> arc_app_icon_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_ | |
| OLD | NEW |