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

Unified Diff: components/proximity_auth/screenlock_bridge.h

Issue 1096293003: Move screenlock_bridge to components/proximity_auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add proximity auth client and the chrome glue. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/screenlock_bridge.h
diff --git a/chrome/browser/signin/screenlock_bridge.h b/components/proximity_auth/screenlock_bridge.h
similarity index 88%
rename from chrome/browser/signin/screenlock_bridge.h
rename to components/proximity_auth/screenlock_bridge.h
index d376f68ccbd18b2b8fc62aed93c37f3d27e790a2..98f0b7fc313dae35dd5f3d211d77c1c4b5539fcf 100644
--- a/chrome/browser/signin/screenlock_bridge.h
+++ b/components/proximity_auth/screenlock_bridge.h
@@ -2,21 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_
-#define CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_
+#ifndef COMPONENTS_PROXIMITY_AUTH_SCREENLOCK_BRIDGE_H_
+#define COMPONENTS_PROXIMITY_AUTH_SCREENLOCK_BRIDGE_H_
#include <string>
#include "base/basictypes.h"
-#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "base/values.h"
+namespace content {
+class BrowserContext;
+} // namespace content
-class Profile;
+class ProximityAuthClient;
// ScreenlockBridge brings together the screenLockPrivate API and underlying
// support. On ChromeOS, it delegates calls to the ScreenLocker. On other
@@ -25,6 +27,9 @@ class Profile;
// used solely for the lock screen anymore.
class ScreenlockBridge {
Ilya Sherman 2015/04/23 20:52:53 Please ensconce this in the proximity_auth namespa
msarda 2015/04/24 15:47:06 Done.
public:
+ explicit ScreenlockBridge(ProximityAuthClient* client);
+ ~ScreenlockBridge();
+
// User pod icons supported by lock screen / signin screen UI.
enum UserPodCustomIcon {
USER_POD_CUSTOM_ICON_NONE,
@@ -99,11 +104,7 @@ class ScreenlockBridge {
FORCE_OFFLINE_PASSWORD = 5
};
- enum ScreenType {
- SIGNIN_SCREEN = 0,
- LOCK_SCREEN = 1,
- OTHER_SCREEN = 2
- };
+ enum ScreenType { SIGNIN_SCREEN = 0, LOCK_SCREEN = 1, OTHER_SCREEN = 2 };
// Displays |message| in a banner on the lock screen.
virtual void ShowBannerMessage(const base::string16& message) = 0;
@@ -130,7 +131,7 @@ class ScreenlockBridge {
// Returns the type of the screen -- a signin or a lock screen.
virtual ScreenType GetScreenType() const = 0;
- // Unlock from easy unlock app for a user.
+ // Unlocks from easy unlock app for a user.
virtual void Unlock(const std::string& user_email) = 0;
// Attempts to login the user using an easy unlock key.
@@ -157,15 +158,12 @@ class ScreenlockBridge {
virtual ~Observer() {}
};
- static ScreenlockBridge* Get();
- static std::string GetAuthenticatedUserEmail(const Profile* profile);
-
void SetLockHandler(LockHandler* lock_handler);
void SetFocusedUser(const std::string& user_id);
bool IsLocked() const;
- void Lock(Profile* profile);
- void Unlock(Profile* profile);
+ void Lock(content::BrowserContext* browser_context);
+ void Unlock(content::BrowserContext* browser_context);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -175,13 +173,8 @@ class ScreenlockBridge {
std::string focused_user_id() const { return focused_user_id_; }
private:
- friend struct base::DefaultLazyInstanceTraits<ScreenlockBridge>;
- friend struct base::DefaultDeleter<ScreenlockBridge>;
-
- ScreenlockBridge();
- ~ScreenlockBridge();
-
- LockHandler* lock_handler_; // Not owned
+ ProximityAuthClient* client_; // Not owned. Must outlive this object.
+ LockHandler* lock_handler_; // Not owned
// The last focused user's id.
std::string focused_user_id_;
ObserverList<Observer, true> observers_;
@@ -189,4 +182,4 @@ class ScreenlockBridge {
DISALLOW_COPY_AND_ASSIGN(ScreenlockBridge);
};
-#endif // CHROME_BROWSER_SIGNIN_SCREENLOCK_BRIDGE_H_
+#endif // COMPONENTS_PROXIMITY_AUTH_SCREENLOCK_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698