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

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

Issue 2052603002: Restore calls to MessageLoopForUI::current in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing includes Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/location.h" 6 #include "base/location.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h"
11 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h" 11 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h"
13 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 12 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
14 #include "chrome/grit/generated_resources.h" 13 #include "chrome/grit/generated_resources.h"
15 #include "chromeos/dbus/dbus_thread_manager.h" 14 #include "chromeos/dbus/dbus_thread_manager.h"
16 #include "chromeos/dbus/session_manager_client.h" 15 #include "chromeos/dbus/session_manager_client.h"
17 #include "chromeos/login/auth/auth_status_consumer.h" 16 #include "chromeos/login/auth/auth_status_consumer.h"
18 #include "chromeos/login/auth/user_context.h" 17 #include "chromeos/login/auth/user_context.h"
19 #include "components/proximity_auth/screenlock_bridge.h" 18 #include "components/proximity_auth/screenlock_bridge.h"
20 #include "content/public/browser/notification_details.h" 19 #include "content/public/browser/notification_details.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DCHECK(lock_users.size() == 1); 89 DCHECK(lock_users.size() == 1);
91 proximity_auth::ScreenlockBridge::Get() 90 proximity_auth::ScreenlockBridge::Get()
92 ->lock_handler() 91 ->lock_handler()
93 ->ShowUserPodCustomIcon(lock_users[0]->GetAccountId(), icon_options); 92 ->ShowUserPodCustomIcon(lock_users[0]->GetAccountId(), icon_options);
94 } 93 }
95 94
96 // chromeos::AuthStatusConsumer: 95 // chromeos::AuthStatusConsumer:
97 void OnAuthSuccess(const chromeos::UserContext& user_context) override { 96 void OnAuthSuccess(const chromeos::UserContext& user_context) override {
98 callback_.Run(user_context); 97 callback_.Run(user_context);
99 // Schedule deletion. 98 // Schedule deletion.
100 base::ThreadTaskRunnerHandle::Get()->PostTask( 99 base::MessageLoopForUI::current()->task_runner()->PostTask(
101 FROM_HERE, base::Bind(&EndReauthAttempt)); 100 FROM_HERE, base::Bind(&EndReauthAttempt));
102 } 101 }
103 102
104 void OnAuthFailure(const chromeos::AuthFailure& error) override {} 103 void OnAuthFailure(const chromeos::AuthFailure& error) override {}
105 104
106 private: 105 private:
107 content::NotificationRegistrar notification_registrar_; 106 content::NotificationRegistrar notification_registrar_;
108 EasyUnlockReauth::UserContextCallback callback_; 107 EasyUnlockReauth::UserContextCallback callback_;
109 108
110 DISALLOW_COPY_AND_ASSIGN(ReauthHandler); 109 DISALLOW_COPY_AND_ASSIGN(ReauthHandler);
(...skipping 15 matching lines...) Expand all
126 base::Callback<void(const UserContext&)> callback) { 125 base::Callback<void(const UserContext&)> callback) {
127 DCHECK(base::MessageLoopForUI::IsCurrent()); 126 DCHECK(base::MessageLoopForUI::IsCurrent());
128 if (g_reauth_handler) 127 if (g_reauth_handler)
129 return false; 128 return false;
130 129
131 g_reauth_handler = new ReauthHandler(callback); 130 g_reauth_handler = new ReauthHandler(callback);
132 return g_reauth_handler->Start(); 131 return g_reauth_handler->Start();
133 } 132 }
134 133
135 } // namespace chromeos 134 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698