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

Side by Side Diff: chrome/browser/chromeos/lock_screen_apps/app_manager.h

Issue 2902293002: Introduce lock screen app manager (Closed)
Patch Set: . Created 3 years, 7 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
(Empty)
1 // Copyright 2017 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_LOCK_SCREEN_APPS_APP_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOCK_SCREEN_APPS_APP_MANAGER_H_
7
8 #include <string>
9
10 class Profile;
11
12 namespace lock_screen_apps {
13
14 // Interface for managing lock screen enabled action handler apps in the lock
15 // screen enabled profile. Initially, it will be used primarily to manage lock
16 // screen note taking apps.
17 class AppManager {
18 public:
19 class Observer {
20 public:
21 virtual ~Observer() {}
22
23 // Called when note taking availability status changes while the
24 // |AppManager| is active.
25 virtual void OnNoteTakingAvailabilityChanged() = 0;
26 };
27
28 virtual ~AppManager() {}
29
30 // Initializes the manager.
31 // |primary_profile| - the profile which is the source of the lock screen
32 // action handler app (if one is set). This is the profile whose
33 // settings are used to determine whether and for which app lock screen
34 // action is enabled.
35 // |lock_screen_profile| - the profile in which lock screen apps should be
36 // installed and launched.
37 virtual void Initialize(Profile* primary_profile,
38 Profile* lock_screen_profile) = 0;
39
40 // Activates the manager - this should ensure that lock screen enabled note
41 // taking app, if available, is loaded and enabled in the lock screen profile.
42 // |observer| - used to notify the user when the note taking app availability
43 // changes. It's cleared when the |AppManager| is stopped.
44 virtual void Start(Observer* observer) = 0;
xiyuan 2017/05/26 22:44:52 Prefer to use a Callback than using an interface p
tbarzic 2017/05/27 00:48:35 Done.
45
46 // Stops the manager. After this is called, the app can be unloaded from the
47 // lock screen enabled profile. Subsequent launch requests should not be
48 // allowed.
49 virtual void Stop() = 0;
50
51 // If lock screen note taking app is available, launches the app with lock
52 // screen note taking action.
53 // Returns whether the app launch was attempted.
54 virtual bool LaunchNoteTaking() = 0;
55
56 // Returns whether a lock screen note taking is enabled and ready to launch.
57 virtual bool IsNoteTakingAppAvailable() const = 0;
58
59 // Returns the lock screen enabled lock screen note taking app, if a note
60 // taking app is enabled on lock screen (for primary profile).
61 virtual std::string GetNoteTakingAppId() const = 0;
62 };
63
64 } // namespace lock_screen_apps
65
66 #endif // CHROME_BROWSER_CHROMEOS_LOCK_SCREEN_APPS_APP_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698