| 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..23751bb6ff3a8524d064ea6699cee520041a32df
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/app_list/arc_app_item.h
|
| @@ -0,0 +1,62 @@
|
| +// 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 "ui/app_list/app_list_item.h"
|
| +#include "ui/base/layout.h"
|
| +#include "ui/gfx/image/image.h"
|
| +#include "ui/gfx/image/image_skia.h"
|
| +
|
| +class Profile;
|
| +
|
| +namespace base {
|
| +class FilePath;
|
| +}
|
| +
|
| +namespace content {
|
| +class BrowserContext;
|
| +}
|
| +
|
| +// ArcAppItem represents an Arc app in app list.
|
| +class ArcAppItem : public app_list::AppListItem {
|
| + public:
|
| + static const char kItemType[];
|
| +
|
| + ArcAppItem(content::BrowserContext* context,
|
| + const std::string& id,
|
| + const std::string& name,
|
| + bool ready);
|
| + ~ArcAppItem() override;
|
| +
|
| + void SetName(const std::string& name);
|
| +
|
| + void Activate(int event_flags) override;
|
| + const char* GetItemType() const override;
|
| +
|
| + void SetReady(bool ready);
|
| + void UpdateIcon(ui::ScaleFactor scale_factor, const base::FilePath& path);
|
| +
|
| + private:
|
| + content::BrowserContext* context_;
|
| + bool ready_;
|
| + gfx::ImageSkia image_skia_;
|
| + gfx::Image image_;
|
| +
|
| + base::WeakPtrFactory<ArcAppItem> weak_ptr_factory_;
|
| +
|
| + void UpdateIcon();
|
| + void UpdateIcon(const gfx::ImageSkia* image);
|
| + void UpdateIconOnBlockingThread(ui::ScaleFactor scale_factor,
|
| + const base::FilePath& path);
|
| + void OnIconLoaded(const gfx::Image& image_in);
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ArcAppItem);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_APP_LIST_ARC_APP_ITEM_H_
|
|
|