| 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..5ea5febe16b696ddf1327b994a474d259fabda82
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h
|
| @@ -0,0 +1,57 @@
|
| +// 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,
|
| + ArcAppListPrefs* prefs,
|
| + 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:
|
| + // Check whether it's the app's window and pins it.
|
| + bool CheckAndPinWindow(aura::Window* const window);
|
| + void StopObserving();
|
| +
|
| + const std::string app_id_;
|
| + ArcAppListPrefs* const 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_
|
|
|