Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ | |
| 7 | |
| 8 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | |
| 9 #include "ui/aura/env_observer.h" | |
| 10 #include "ui/aura/window.h" | |
| 11 #include "ui/aura/window_observer.h" | |
| 12 | |
| 13 namespace chromeos { | |
| 14 | |
| 15 // Starts Android app in kiosk mode. | |
| 16 // Keeps track of start progress and pins app window | |
| 17 // when it's finally opened. | |
| 18 class ArcKioskAppLauncher : public ArcAppListPrefs::Observer, | |
| 19 public aura::EnvObserver, | |
| 20 public aura::WindowObserver { | |
| 21 public: | |
| 22 ArcKioskAppLauncher(content::BrowserContext* context, | |
| 23 const std::string& app_id); | |
| 24 | |
| 25 ~ArcKioskAppLauncher() override; | |
| 26 | |
| 27 // ArcAppListPrefs::Observer overrides. | |
| 28 void OnTaskCreated(int32_t task_id, | |
| 29 const std::string& package_name, | |
| 30 const std::string& activity) override; | |
| 31 | |
| 32 // aura::EnvObserver overrides. | |
| 33 void OnWindowInitialized(aura::Window* window) override; | |
| 34 | |
| 35 // aura::WindowObserver overrides. | |
| 36 void OnWindowPropertyChanged(aura::Window* window, | |
| 37 const void* key, | |
| 38 intptr_t old) override; | |
| 39 void OnWindowDestroying(aura::Window* window) override; | |
| 40 | |
| 41 private: | |
| 42 bool CheckWindow(aura::Window* const window); | |
|
Nikita (slow)
2016/11/16 15:33:28
nit: method comment
Sergey Poromov
2016/11/16 15:54:09
Done.
| |
| 43 void StopObserving(); | |
| 44 | |
| 45 std::string app_id_; | |
| 46 ArcAppListPrefs* prefs_; | |
| 47 int task_id_ = -1; | |
| 48 std::set<aura::Window*> windows_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppLauncher); | |
| 51 }; | |
| 52 | |
| 53 } // namespace chromeos | |
| 54 | |
| 55 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ | |
| OLD | NEW |