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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/screenlock_private_api.h
diff --git a/chrome/browser/chromeos/extensions/screenlock_private_api.h b/chrome/browser/chromeos/extensions/screenlock_private_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f4e228006174e2c05539d22ae5bce1ca10e4ed4
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/screenlock_private_api.h
@@ -0,0 +1,80 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
+
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
+#include "chrome/browser/extensions/chrome_extension_function.h"
+#include "chromeos/dbus/session_manager_client.h"
+
+namespace extensions {
+
+class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked",
+ SCREENLOCKPRIVATE_GETLOCKED)
+ ScreenlockPrivateGetLockedFunction();
+ virtual bool RunImpl() OVERRIDE;
+ private:
+ virtual ~ScreenlockPrivateGetLockedFunction();
+ DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction);
+};
+
+class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked",
+ SCREENLOCKPRIVATE_SETLOCKED)
+ ScreenlockPrivateSetLockedFunction();
+ virtual bool RunImpl() OVERRIDE;
+ private:
+ virtual ~ScreenlockPrivateSetLockedFunction();
+ DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction);
+};
+
+class ScreenlockPrivateShowMessageFunction
+ : public ChromeAsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage",
+ SCREENLOCKPRIVATE_SHOWMESSAGE)
+ ScreenlockPrivateShowMessageFunction();
+ virtual bool RunImpl() OVERRIDE;
+ private:
+ virtual ~ScreenlockPrivateShowMessageFunction();
+ DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction );
+};
+
+class ScreenlockPrivateEventRouter
+ : public extensions::ProfileKeyedAPI,
+ public chromeos::SessionManagerClient::Observer {
+ public:
+ explicit ScreenlockPrivateEventRouter(Profile* profile);
+ virtual ~ScreenlockPrivateEventRouter();
+ virtual void ScreenIsLocked() OVERRIDE;
+ virtual void ScreenIsUnlocked() OVERRIDE;
+
+ // ProfileKeyedAPI
+ static extensions::ProfileKeyedAPIFactory<ScreenlockPrivateEventRouter>*
+ GetFactoryInstance();
+ virtual void Shutdown() OVERRIDE;
+
+ private:
+ friend class extensions::ProfileKeyedAPIFactory<ScreenlockPrivateEventRouter>;
+
+ // ProfileKeyedAPI
+ static const char* service_name() {
+ return "ScreenlockPrivateEventRouter";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+ static const bool kServiceRedirectedInIncognito = true;
+
+ void DispatchEvent(const std::string& event_name, base::Value* arg);
+
+ Profile* profile_;
+ DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_SCREENLOCK_PRIVATE_API_H_
« 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