1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_APP_MANAGER_H_
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_APP_MANAGER_H_
10 #include "base/callback.h"
11 #include "base/files/file_path.h"
12 #include "base/macros.h"
14 namespace extensions
{
15 class ExtensionSystem
;
18 // Used to manage Easy Unlock app's lifetime and to dispatch events to the app.
19 // It's main purpose is to abstract extension system from the rest of easy
21 class EasyUnlockAppManager
{
23 virtual ~EasyUnlockAppManager();
25 // Creates EasyUnlockAppManager object that should be used in production.
26 static scoped_ptr
<EasyUnlockAppManager
> Create(
27 extensions::ExtensionSystem
* extension_system
,
29 const base::FilePath
& app_path
);
31 // Wait for the extension system to get ready and invokes |ready_callback|
33 // Note that the callback may be triggered after |this| is deleted.
34 virtual void EnsureReady(const base::Closure
& ready_callback
) = 0;
36 // Launches Easy Unlock setup app, if the setup app is loaded.
37 virtual void LaunchSetup() = 0;
39 // Loads Easy Unlock app.
40 virtual void LoadApp() = 0;
42 // Disables Easy Unlock app.
43 virtual void DisableAppIfLoaded() = 0;
45 // Reloads Easy Unlock app.
46 virtual void ReloadApp() = 0;
48 // Sends easyUnlockPrivate.onUserInfoUpdate event to Easy Unlock app.
49 virtual bool SendUserUpdatedEvent(const std::string
& user_id
,
53 // Sends screenlockPrivate.onAuthAttempted event to Easy Unlock app.
54 virtual bool SendAuthAttemptEvent() = 0;
57 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_APP_MANAGER_H_