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

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.cc

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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h" 8 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h"
9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
10 #include "chrome/browser/signin/screenlock_bridge.h" 10 #include "chrome/browser/signin/easy_unlock_util.h"
11 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
12 #include "chromeos/dbus/dbus_thread_manager.h" 12 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "chromeos/dbus/session_manager_client.h" 13 #include "chromeos/dbus/session_manager_client.h"
14 #include "chromeos/login/auth/auth_status_consumer.h" 14 #include "chromeos/login/auth/auth_status_consumer.h"
15 #include "chromeos/login/auth/user_context.h" 15 #include "chromeos/login/auth/user_context.h"
16 #include "components/proximity_auth/screenlock_bridge.h"
16 #include "content/public/browser/notification_details.h" 17 #include "content/public/browser/notification_details.h"
17 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
18 #include "content/public/browser/notification_registrar.h" 19 #include "content/public/browser/notification_registrar.h"
19 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
20 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
21 22
22 namespace chromeos { 23 namespace chromeos {
23 24
24 namespace { 25 namespace {
25 26
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Show tooltip explaining reauth. 77 // Show tooltip explaining reauth.
77 ScreenlockBridge::UserPodCustomIconOptions icon_options; 78 ScreenlockBridge::UserPodCustomIconOptions icon_options;
78 icon_options.SetIcon(ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE); 79 icon_options.SetIcon(ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE);
79 icon_options.SetTooltip( 80 icon_options.SetTooltip(
80 l10n_util::GetStringUTF16( 81 l10n_util::GetStringUTF16(
81 IDS_SMART_LOCK_SCREENLOCK_TOOLTIP_HARDLOCK_REAUTH_USER), 82 IDS_SMART_LOCK_SCREENLOCK_TOOLTIP_HARDLOCK_REAUTH_USER),
82 true); 83 true);
83 84
84 const user_manager::UserList& lock_users = screen_locker->users(); 85 const user_manager::UserList& lock_users = screen_locker->users();
85 DCHECK(lock_users.size() == 1); 86 DCHECK(lock_users.size() == 1);
86 ScreenlockBridge::Get()->lock_handler()->ShowUserPodCustomIcon( 87 GetScreenlockBridgeInstance()->lock_handler()->ShowUserPodCustomIcon(
87 lock_users[0]->email(), icon_options); 88 lock_users[0]->email(), icon_options);
88 } 89 }
89 90
90 // chromeos::AuthStatusConsumer: 91 // chromeos::AuthStatusConsumer:
91 void OnAuthSuccess(const chromeos::UserContext& user_context) override { 92 void OnAuthSuccess(const chromeos::UserContext& user_context) override {
92 callback_.Run(user_context); 93 callback_.Run(user_context);
93 // Schedule deletion. 94 // Schedule deletion.
94 base::MessageLoopForUI::current()->PostTask(FROM_HERE, 95 base::MessageLoopForUI::current()->PostTask(FROM_HERE,
95 base::Bind(&EndReauthAttempt)); 96 base::Bind(&EndReauthAttempt));
96 } 97 }
(...skipping 23 matching lines...) Expand all
120 base::Callback<void(const UserContext&)> callback) { 121 base::Callback<void(const UserContext&)> callback) {
121 DCHECK(base::MessageLoopForUI::IsCurrent()); 122 DCHECK(base::MessageLoopForUI::IsCurrent());
122 if (g_reauth_handler) 123 if (g_reauth_handler)
123 return false; 124 return false;
124 125
125 g_reauth_handler = new ReauthHandler(callback); 126 g_reauth_handler = new ReauthHandler(callback);
126 return g_reauth_handler->Start(); 127 return g_reauth_handler->Start();
127 } 128 }
128 129
129 } // namespace chromeos 130 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698