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

Side by Side Diff: chrome/browser/chromeos/extensions/screenlock_private_api.h

Issue 60583003: The chrome.screenlockPrivate API allows select apps to control the ChromeOS ScreenLocker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
7
8 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chromeos/dbus/session_manager_client.h"
11
12 namespace extensions {
13
14 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction {
15 public:
16 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked",
17 SCREENLOCKPRIVATE_GETLOCKED)
18 ScreenlockPrivateGetLockedFunction();
19 virtual bool RunImpl() OVERRIDE;
20 private:
21 virtual ~ScreenlockPrivateGetLockedFunction();
22 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction);
23 };
24
25 class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction {
26 public:
27 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked",
28 SCREENLOCKPRIVATE_SETLOCKED)
29 ScreenlockPrivateSetLockedFunction();
30 virtual bool RunImpl() OVERRIDE;
31 private:
32 virtual ~ScreenlockPrivateSetLockedFunction();
33 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction);
34 };
35
36 class ScreenlockPrivateShowMessageFunction
37 : public ChromeAsyncExtensionFunction {
38 public:
39 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage",
40 SCREENLOCKPRIVATE_SHOWMESSAGE)
41 ScreenlockPrivateShowMessageFunction();
42 virtual bool RunImpl() OVERRIDE;
43 private:
44 virtual ~ScreenlockPrivateShowMessageFunction();
45 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction );
46 };
47
48 class ScreenlockPrivateEventRouter
49 : public extensions::ProfileKeyedAPI,
50 public chromeos::SessionManagerClient::Observer {
51 public:
52 explicit ScreenlockPrivateEventRouter(Profile* profile);
53 virtual ~ScreenlockPrivateEventRouter();
54 virtual void ScreenIsLocked() OVERRIDE;
55 virtual void ScreenIsUnlocked() OVERRIDE;
56
57 // ProfileKeyedAPI
58 static extensions::ProfileKeyedAPIFactory<ScreenlockPrivateEventRouter>*
59 GetFactoryInstance();
60 virtual void Shutdown() OVERRIDE;
61
62 private:
63 friend class extensions::ProfileKeyedAPIFactory<ScreenlockPrivateEventRouter>;
64
65 // ProfileKeyedAPI
66 static const char* service_name() {
67 return "ScreenlockPrivateEventRouter";
68 }
69 static const bool kServiceIsNULLWhileTesting = true;
70 static const bool kServiceRedirectedInIncognito = true;
71
72 void DispatchEvent(const std::string& event_name, base::Value* arg);
73
74 Profile* profile_;
75 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter);
76 };
77
78 } // namespace extensions
79
80 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/extensions/screenlock_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698