Chromium Code Reviews| Index: chrome/browser/ui/app_list/arc/arc_app_model_builder.h |
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_model_builder.h b/chrome/browser/ui/app_list/arc/arc_app_model_builder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..04439c710979f76e5dd3c16be2891d67576db808 |
| --- /dev/null |
| +++ b/chrome/browser/ui/app_list/arc/arc_app_model_builder.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 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_ARC_APP_MODEL_BUILDER_H_ |
| +#define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_MODEL_BUILDER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/ui/app_list/app_list_model_builder.h" |
| +#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| + |
| +class AppListControllerDelegate; |
| +class ArcAppItem; |
| + |
| +// This class populates and maintains ARC apps. |
| +class ArcAppModelBuilder : public AppListModelBuilder, |
| + public ArcAppListPrefs::Observer { |
| + public: |
| + explicit ArcAppModelBuilder(AppListControllerDelegate* controller); |
| + ~ArcAppModelBuilder() override; |
| + |
| + private: |
| + // AppListModelBuilder |
| + void BuildModel() override; |
| + |
| + // ArcAppListPrefs::Observer |
| + void OnAppRegistered(const std::string& app_id, |
| + const ArcAppListPrefs::AppInfo& app_info) override; |
| + void OnAppReadyChanged(const std::string& app_id, bool ready) override; |
| + void OnAppIconUpdated(const std::string& app_id, |
| + ui::ScaleFactor scale_factor) override; |
| + |
| + // AppListItemListObserver. |
| + void OnListItemMoved(size_t from_index, |
| + size_t to_index, |
| + app_list::AppListItem* item) override; |
| + |
| + scoped_ptr<ArcAppItem> CreateApp(const std::string& app_id, |
| + const ArcAppListPrefs::AppInfo& info); |
| + |
| + ArcAppItem* GetArcAppItem(const std::string& app_id); |
| + |
| + ArcAppListPrefs* prefs_ = nullptr; |
|
jochen (gone - plz use gerrit)
2015/12/03 10:25:40
please initialize in ctor
khmel1
2015/12/03 12:34:49
I was asked by Xiyuan to use this style. I followe
jochen (gone - plz use gerrit)
2015/12/03 12:55:51
the style guide doesn't say anything on this, but
khmel1
2015/12/03 14:12:41
Ok, thanks for pointing, I removed this style in m
xiyuan
2015/12/03 17:58:43
This is allowed in chromium.
https://chromium-cpp.
khmel1
2015/12/04 01:34:11
Thanks Xiyuan for the link, yes, they are official
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcAppModelBuilder); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_MODEL_BUILDER_H_ |