Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_launcher.h

Issue 2649103006: arc: Add splash screen for ARC++ Kiosk startup (Closed)
Patch Set: use base::Bind for timer start Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ 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_ 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_
7 7
8 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 8 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
9 #include "ui/aura/env_observer.h" 9 #include "ui/aura/env_observer.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 #include "ui/aura/window_observer.h" 11 #include "ui/aura/window_observer.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 // Starts Android app in kiosk mode. 15 // Starts Android app in kiosk mode.
16 // Keeps track of start progress and pins app window 16 // Keeps track of start progress and pins app window
17 // when it's finally opened. 17 // when it's finally opened.
18 class ArcKioskAppLauncher : public ArcAppListPrefs::Observer, 18 class ArcKioskAppLauncher : public ArcAppListPrefs::Observer,
19 public aura::EnvObserver, 19 public aura::EnvObserver,
20 public aura::WindowObserver { 20 public aura::WindowObserver {
21 public: 21 public:
22 class Delegate {
23 public:
24 virtual void OnAppWindowLaunched() = 0;
25
26 protected:
27 virtual ~Delegate() = default;
achuithb 2017/02/03 00:35:00 Let's also have a private section with DISALLOW_CO
Sergey Poromov 2017/02/03 15:15:36 Done.
28 };
29
22 ArcKioskAppLauncher(content::BrowserContext* context, 30 ArcKioskAppLauncher(content::BrowserContext* context,
23 ArcAppListPrefs* prefs, 31 ArcAppListPrefs* prefs,
24 const std::string& app_id); 32 const std::string& app_id,
33 Delegate* delegate);
25 34
26 ~ArcKioskAppLauncher() override; 35 ~ArcKioskAppLauncher() override;
27 36
28 // ArcAppListPrefs::Observer overrides. 37 // ArcAppListPrefs::Observer overrides.
29 void OnTaskCreated(int32_t task_id, 38 void OnTaskCreated(int32_t task_id,
30 const std::string& package_name, 39 const std::string& package_name,
31 const std::string& activity, 40 const std::string& activity,
32 const std::string& intent) override; 41 const std::string& intent) override;
33 42
34 // aura::EnvObserver overrides. 43 // aura::EnvObserver overrides.
35 void OnWindowInitialized(aura::Window* window) override; 44 void OnWindowInitialized(aura::Window* window) override;
36 45
37 // aura::WindowObserver overrides. 46 // aura::WindowObserver overrides.
38 void OnWindowPropertyChanged(aura::Window* window, 47 void OnWindowPropertyChanged(aura::Window* window,
39 const void* key, 48 const void* key,
40 intptr_t old) override; 49 intptr_t old) override;
41 void OnWindowDestroying(aura::Window* window) override; 50 void OnWindowDestroying(aura::Window* window) override;
42 51
43 private: 52 private:
44 // Check whether it's the app's window and pins it. 53 // Check whether it's the app's window and pins it.
45 bool CheckAndPinWindow(aura::Window* const window); 54 bool CheckAndPinWindow(aura::Window* const window);
46 void StopObserving(); 55 void StopObserving();
47 56
48 const std::string app_id_; 57 const std::string app_id_;
49 ArcAppListPrefs* const prefs_; 58 ArcAppListPrefs* const prefs_;
50 int task_id_ = -1; 59 int task_id_ = -1;
51 std::set<aura::Window*> windows_; 60 std::set<aura::Window*> windows_;
61 // Not owning the delegate, delegate owns this class.
62 Delegate* const delegate_;
52 63
53 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppLauncher); 64 DISALLOW_COPY_AND_ASSIGN(ArcKioskAppLauncher);
54 }; 65 };
55 66
56 } // namespace chromeos 67 } // namespace chromeos
57 68
58 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_ 69 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698