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

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

Issue 5641001: [cros] Fetch cookies after online authentication is successful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/login_performer.h" 5 #include "chrome/browser/chromeos/login/login_performer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browser_thread.h" 14 #include "chrome/browser/browser_thread.h"
15 #include "chrome/browser/chromeos/boot_times_loader.h" 15 #include "chrome/browser/chromeos/boot_times_loader.h"
16 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/cros/screen_lock_library.h" 17 #include "chrome/browser/chromeos/cros/screen_lock_library.h"
18 #include "chrome/browser/chromeos/login/login_utils.h" 18 #include "chrome/browser/chromeos/login/login_utils.h"
19 #include "chrome/browser/chromeos/login/screen_locker.h" 19 #include "chrome/browser/chromeos/login/screen_locker.h"
20 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 20 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/profiles/profile_manager.h"
21 #include "chrome/common/notification_service.h" 23 #include "chrome/common/notification_service.h"
22 #include "chrome/common/notification_type.h" 24 #include "chrome/common/notification_type.h"
23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/profiles/profile_manager.h"
25 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
26 26
27 namespace chromeos { 27 namespace chromeos {
28 28
29 // Initialize default LoginPerformer. 29 // Initialize default LoginPerformer.
30 // static 30 // static
31 LoginPerformer* LoginPerformer::default_performer_ = NULL; 31 LoginPerformer* LoginPerformer::default_performer_ = NULL;
32 32
33 LoginPerformer::LoginPerformer(Delegate* delegate) 33 LoginPerformer::LoginPerformer(Delegate* delegate)
34 : last_login_failure_(LoginFailure::None()), 34 : last_login_failure_(LoginFailure::None()),
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // LoginPerformer ownership. LP now manages it's lifetime on its own. 108 // LoginPerformer ownership. LP now manages it's lifetime on its own.
109 // 2 things could make it exist longer: 109 // 2 things could make it exist longer:
110 // 1. ScreenLock active (pending correct new password input) 110 // 1. ScreenLock active (pending correct new password input)
111 // 2. Pending online auth request. 111 // 2. Pending online auth request.
112 if (!pending_requests) 112 if (!pending_requests)
113 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 113 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
114 } else { 114 } else {
115 DCHECK(!pending_requests) 115 DCHECK(!pending_requests)
116 << "Pending request w/o delegate_ should not happen!"; 116 << "Pending request w/o delegate_ should not happen!";
117 // Online login has succeeded. 117 // Online login has succeeded.
118 // TODO(nkostylev): Execute CookieFetcher->AttemptFetch() here once 118 // TODO(nkostylev): Execute CookieFetcher->AttemptFetch() here once
Chris Masone 2010/12/03 16:40:02 can take this comment out now :-)
Nikita (slow) 2010/12/03 16:49:43 Done.
119 // async login is implemented. 119 // async login is implemented.
120 // http://crosbug.com/9814 120 // http://crosbug.com/9814
121 Profile* profile =
122 g_browser_process->profile_manager()->GetDefaultProfile();
123 LoginUtils::Get()->FetchCookies(profile, credentials);
124 LoginUtils::Get()->FetchTokens(profile, credentials);
125
121 if (ScreenLocker::default_screen_locker()) { 126 if (ScreenLocker::default_screen_locker()) {
122 DVLOG(1) << "Online login OK - unlocking screen."; 127 DVLOG(1) << "Online login OK - unlocking screen.";
123 RequestScreenUnlock(); 128 RequestScreenUnlock();
124 // Do not delete itself just yet, wait for unlock. 129 // Do not delete itself just yet, wait for unlock.
125 // See ResolveScreenUnlocked(). 130 // See ResolveScreenUnlocked().
126 return; 131 return;
127 } 132 }
128 // There's nothing else that's holding LP from deleting itself - 133 // There's nothing else that's holding LP from deleting itself -
129 // no ScreenLock, no pending requests. 134 // no ScreenLock, no pending requests.
130 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 135 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 profile, 433 profile,
429 username_, 434 username_,
430 password_, 435 password_,
431 captcha_token_, 436 captcha_token_,
432 captcha_)); 437 captcha_));
433 } 438 }
434 password_.clear(); 439 password_.clear();
435 } 440 }
436 441
437 } // namespace chromeos 442 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.cc ('k') | chrome/browser/chromeos/login/login_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698