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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 10837124: Ignore duplicated event CompleteLogin from UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 string16 ExistingUserController::GetConnectedNetworkName() { 298 string16 ExistingUserController::GetConnectedNetworkName() {
299 return GetCurrentNetworkName(CrosLibrary::Get()->GetNetworkLibrary()); 299 return GetCurrentNetworkName(CrosLibrary::Get()->GetNetworkLibrary());
300 } 300 }
301 301
302 void ExistingUserController::SetDisplayEmail(const std::string& email) { 302 void ExistingUserController::SetDisplayEmail(const std::string& email) {
303 display_email_ = email; 303 display_email_ = email;
304 } 304 }
305 305
306 void ExistingUserController::CompleteLogin(const std::string& username, 306 void ExistingUserController::CompleteLogin(const std::string& username,
307 const std::string& password) { 307 const std::string& password) {
308 if (!host_) {
309 // Complete login event was generated already from UI. Ignore notification.
310 return;
311 }
308 if (!time_init_.is_null()) { 312 if (!time_init_.is_null()) {
309 base::TimeDelta delta = base::Time::Now() - time_init_; 313 base::TimeDelta delta = base::Time::Now() - time_init_;
310 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta); 314 UMA_HISTOGRAM_MEDIUM_TIMES("Login.PromptToCompleteLoginTime", delta);
311 time_init_ = base::Time(); // Reset to null. 315 time_init_ = base::Time(); // Reset to null.
312 } 316 }
313 host_->OnCompleteLogin(); 317 host_->OnCompleteLogin();
314 // Auto-enrollment must have made a decision by now. It's too late to enroll 318 // Auto-enrollment must have made a decision by now. It's too late to enroll
315 // if the protocol isn't done at this point. 319 // if the protocol isn't done at this point.
316 if (do_auto_enrollment_) { 320 if (do_auto_enrollment_) {
317 VLOG(1) << "Forcing auto-enrollment before completing login"; 321 VLOG(1) << "Forcing auto-enrollment before completing login";
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 // Invalidate OAuth token, since it can't be correct after password is 924 // Invalidate OAuth token, since it can't be correct after password is
921 // changed. 925 // changed.
922 UserManager::Get()->SaveUserOAuthStatus(username, 926 UserManager::Get()->SaveUserOAuthStatus(username,
923 User::OAUTH_TOKEN_STATUS_INVALID); 927 User::OAUTH_TOKEN_STATUS_INVALID);
924 928
925 login_display_->SetUIEnabled(true); 929 login_display_->SetUIEnabled(true);
926 login_display_->ShowGaiaPasswordChanged(username); 930 login_display_->ShowGaiaPasswordChanged(username);
927 } 931 }
928 932
929 } // namespace chromeos 933 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698