 Chromium Code Reviews
 Chromium Code Reviews Issue 2496903003:
  arc: Add Arc Kiosk app service and ability to launch kiosk apps.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse
    
  
    Issue 2496903003:
  arc: Add Arc Kiosk app service and ability to launch kiosk apps.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse| Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h | 
| diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..a5251aebfe331dcc7867481be4279e4d696a0b00 | 
| --- /dev/null | 
| +++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h | 
| @@ -0,0 +1,55 @@ | 
| +// 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_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ | 
| +#define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ | 
| + | 
| +#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 
| +#include "ui/aura/env_observer.h" | 
| +#include "ui/aura/window.h" | 
| +#include "ui/aura/window_observer.h" | 
| + | 
| +namespace chromeos { | 
| + | 
| +// Starts Android app in kiosk mode. | 
| +// Keeps track of start progress and pins app window | 
| +// when it's finally opened. | 
| +class ArcKioskAppLauncher : public ArcAppListPrefs::Observer, | 
| + public aura::EnvObserver, | 
| + public aura::WindowObserver { | 
| + public: | 
| + ArcKioskAppLauncher(content::BrowserContext* context, | 
| + const std::string& app_id); | 
| + | 
| + ~ArcKioskAppLauncher() override; | 
| + | 
| + // ArcAppListPrefs::Observer overrides. | 
| + void OnTaskCreated(int32_t task_id, | 
| + const std::string& package_name, | 
| + const std::string& activity) override; | 
| + | 
| + // aura::EnvObserver overrides. | 
| + void OnWindowInitialized(aura::Window* window) override; | 
| + | 
| + // aura::WindowObserver overrides. | 
| + void OnWindowPropertyChanged(aura::Window* window, | 
| + const void* key, | 
| + intptr_t old) override; | 
| + void OnWindowDestroying(aura::Window* window) override; | 
| + | 
| + private: | 
| + 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.
 | 
| + void StopObserving(); | 
| + | 
| + std::string app_id_; | 
| + ArcAppListPrefs* prefs_; | 
| + int task_id_ = -1; | 
| + std::set<aura::Window*> windows_; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(ArcKioskAppLauncher); | 
| +}; | 
| + | 
| +} // namespace chromeos | 
| + | 
| +#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ |