Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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_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 private ArcAppIcon::Observer { | |
|
xiyuan
2015/11/11 22:15:50
All inheritance should be public.
Details here: h
khmel1
2015/11/12 08:05:30
Thanks for link. Done.
| |
| 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; | |
|
xiyuan
2015/11/11 22:15:50
nit: alignment
khmel1
2015/11/12 08:05:30
Done.
| |
| 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* icon() { return icon_.get(); } | |
|
xiyuan
2015/11/11 22:15:50
Can we give it a different name (e.g arc_app_icon(
khmel1
2015/11/12 08:05:30
Done.
| |
| 38 | |
| 39 void SetReady(bool ready); | |
| 40 private: | |
|
xiyuan
2015/11/11 22:15:50
nit: insert an empty line before
khmel1
2015/11/12 08:05:30
Done.
| |
| 41 content::BrowserContext* context_; | |
| 42 bool ready_; | |
| 43 scoped_ptr<ArcAppIcon> icon_; | |
|
xiyuan
2015/11/11 22:15:50
Move data members after the methods.
khmel1
2015/11/12 08:05:30
Done.
| |
| 44 | |
| 45 // Updates the app item's icon, if necessary making it gray. | |
| 46 void UpdateIcon(); | |
| 47 | |
| 48 // ArcAppIcon::Observer | |
| 49 void OnIconUpdated() override; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_ | |
| OLD | NEW |