| Index: chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h
|
| diff --git a/chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h b/chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7180bb1760632f49035e2468800eb365ed353f23
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2016 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_WEBUI_SETTINGS_CHROMEOS_ANDROID_APPS_HANDLER_H_
|
| +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ANDROID_APPS_HANDLER_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/scoped_observer.h"
|
| +#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
|
| +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
|
| +
|
| +class Profile;
|
| +
|
| +namespace base {
|
| +class DictionaryValue;
|
| +}
|
| +
|
| +namespace chromeos {
|
| +namespace settings {
|
| +
|
| +class AndroidAppsHandler : public ::settings::SettingsPageUIHandler,
|
| + public ArcAppListPrefs::Observer {
|
| + public:
|
| + explicit AndroidAppsHandler(Profile* profile);
|
| + ~AndroidAppsHandler() override;
|
| +
|
| + // SettingsPageUIHandler
|
| + void RegisterMessages() override;
|
| + void OnJavascriptAllowed() override;
|
| + void OnJavascriptDisallowed() override;
|
| +
|
| + // ArcAppListPrefs::Observer
|
| + void OnAppReadyChanged(const std::string& app_id, bool ready) override;
|
| + void OnAppRemoved(const std::string& app_id) override;
|
| + void OnAppRegistered(const std::string& app_id,
|
| + const ArcAppListPrefs::AppInfo& app_info) override;
|
| +
|
| + private:
|
| + std::unique_ptr<base::DictionaryValue> BuildAndroidAppsInfo();
|
| + void OnAppChanged(const std::string& app_id);
|
| + void HandleRequestAndroidAppsInfo(const base::ListValue* args);
|
| + void SendAndroidAppsInfo();
|
| + void ShowAndroidAppsSettings(const base::ListValue* args);
|
| +
|
| + ScopedObserver<ArcAppListPrefs, ArcAppListPrefs::Observer>
|
| + arc_prefs_observer_;
|
| + Profile* profile_; // unowned
|
| + base::WeakPtrFactory<AndroidAppsHandler> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AndroidAppsHandler);
|
| +};
|
| +
|
| +} // namespace settings
|
| +} // namespace chromeos
|
| +
|
| +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ANDROID_APPS_HANDLER_H_
|
|
|