OLD | NEW |
---|---|
(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 #include "base/callback.h" | |
xiyuan
2017/06/21 16:09:47
nit: Include callback_forward.h here and callback.
tbarzic
2017/06/21 16:56:18
Done.
| |
11 | |
12 class Profile; | |
13 | |
14 namespace lock_screen_apps { | |
15 | |
16 // Interface for managing lock screen enabled action handler apps in the lock | |
17 // screen enabled profile. Initially, it will be used primarily to manage lock | |
18 // screen note taking apps. | |
19 class AppManager { | |
20 public: | |
21 virtual ~AppManager() {} | |
22 | |
23 // Initializes the manager. | |
24 // |primary_profile| - the profile which is the source of the lock screen | |
25 // action handler app (if one is set). This is the profile whose | |
26 // settings are used to determine whether and for which app lock screen | |
27 // action is enabled, and it should be associated with the primary user. | |
28 // |lock_screen_profile| - the profile in which lock screen apps should be | |
29 // installed and launched. This profile should be annonymous - i.e. not | |
30 // associated with any user. | |
31 virtual void Initialize(Profile* primary_profile, | |
32 Profile* lock_screen_profile) = 0; | |
33 | |
34 // Activates the manager - this should ensure that lock screen enabled note | |
35 // taking app, if available, is loaded and enabled in the lock screen profile. | |
36 // |note_taking_changed_callback| - used to notify the client when the note | |
37 // taking app availability changes. It's cleared when the AppManager is | |
38 // stopped. It is not expected to be run after the app manager instance | |
39 // is destroyed. | |
40 virtual void Start(const base::Closure& note_taking_changed_callback) = 0; | |
41 | |
42 // Stops the manager. After this is called, the app can be unloaded from the | |
43 // lock screen enabled profile. Subsequent launch requests should not be | |
44 // allowed. | |
45 virtual void Stop() = 0; | |
46 | |
47 // If lock screen note taking app is available, launches the app with lock | |
48 // screen note taking action. | |
49 // Returns whether the app launch was attempted. | |
50 virtual bool LaunchNoteTaking() = 0; | |
51 | |
52 // Returns whether a lock screen note taking is enabled and ready to launch. | |
53 virtual bool IsNoteTakingAppAvailable() const = 0; | |
54 | |
55 // Returns the lock screen enabled lock screen note taking app, if a note | |
56 // taking app is enabled on lock screen (for primary profile). | |
57 virtual std::string GetNoteTakingAppId() const = 0; | |
58 }; | |
59 | |
60 } // namespace lock_screen_apps | |
61 | |
62 #endif // CHROME_BROWSER_CHROMEOS_LOCK_SCREEN_APPS_APP_MANAGER_H_ | |
OLD | NEW |