 Chromium Code Reviews
 Chromium Code Reviews Issue 2541923002:
  MD Settings: Add Google Play Store (Arc++) section  (Closed)
    
  
    Issue 2541923002:
  MD Settings: Add Google Play Store (Arc++) section  (Closed) 
  | 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..eb23a2b2d02de49d937617272efc73d281330378 | 
| --- /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 | 
| 
michaelpg
2016/12/01 20:15:34
nit: " overrides." like below
 
stevenjb
2016/12/02 00:39:19
I changed the copied code below. Preferences vary,
 | 
| + void RegisterMessages() override; | 
| + void OnJavascriptAllowed() override; | 
| + void OnJavascriptDisallowed() override; | 
| + | 
| + // ArcAppListPrefs::Observer overrides. | 
| + 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 HandleGetAndroidAppsInfo(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_ |