Chromium Code Reviews| Index: chrome/browser/ui/app_list/arc_app_item.h |
| diff --git a/chrome/browser/ui/app_list/arc_app_item.h b/chrome/browser/ui/app_list/arc_app_item.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e7c21c96829129aea0cedeb4d7d7592ade5cfa5 |
| --- /dev/null |
| +++ b/chrome/browser/ui/app_list/arc_app_item.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_ |
| +#define CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| +#include "chrome/browser/ui/app_list/arc_app_icon.h" |
| +#include "ui/app_list/app_list_item.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +} |
| + |
| +// ArcAppItem represents an Arc app in app list. |
| +class ArcAppItem : public app_list::AppListItem, |
| + 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.
|
| + public: |
| + static const char kItemType[]; |
| + |
| + ArcAppItem(content::BrowserContext* context, |
| + const app_list::AppListSyncableService::SyncItem* sync_item, |
| + const std::string& id, |
| + const std::string& name, |
| + bool ready); |
| + ~ArcAppItem() override; |
|
xiyuan
2015/11/11 22:15:50
nit: alignment
khmel1
2015/11/12 08:05:30
Done.
|
| + |
| + void SetName(const std::string& name); |
| + |
| + void Activate(int event_flags) override; |
| + const char* GetItemType() const override; |
| + |
| + 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.
|
| + |
| + void SetReady(bool ready); |
| + private: |
|
xiyuan
2015/11/11 22:15:50
nit: insert an empty line before
khmel1
2015/11/12 08:05:30
Done.
|
| + content::BrowserContext* context_; |
| + bool ready_; |
| + 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.
|
| + |
| + // Updates the app item's icon, if necessary making it gray. |
| + void UpdateIcon(); |
| + |
| + // ArcAppIcon::Observer |
| + void OnIconUpdated() override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcAppItem); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_ |