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

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

Issue 9169096: Remove a bunch of GetProfileSyncService callers to use the new factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm todos Created 8 years, 11 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
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/screen_locker.h" 5 #include "chrome/browser/chromeos/login/screen_locker.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/chromeos/language_preferences.h" 25 #include "chrome/browser/chromeos/language_preferences.h"
26 #include "chrome/browser/chromeos/login/authenticator.h" 26 #include "chrome/browser/chromeos/login/authenticator.h"
27 #include "chrome/browser/chromeos/login/login_performer.h" 27 #include "chrome/browser/chromeos/login/login_performer.h"
28 #include "chrome/browser/chromeos/login/login_utils.h" 28 #include "chrome/browser/chromeos/login/login_utils.h"
29 #include "chrome/browser/chromeos/login/user_manager.h" 29 #include "chrome/browser/chromeos/login/user_manager.h"
30 #include "chrome/browser/chromeos/login/webui_screen_locker.h" 30 #include "chrome/browser/chromeos/login/webui_screen_locker.h"
31 #include "chrome/browser/profiles/profile.h" 31 #include "chrome/browser/profiles/profile.h"
32 #include "chrome/browser/profiles/profile_manager.h" 32 #include "chrome/browser/profiles/profile_manager.h"
33 #include "chrome/browser/signin/signin_manager.h" 33 #include "chrome/browser/signin/signin_manager.h"
34 #include "chrome/browser/sync/profile_sync_service.h" 34 #include "chrome/browser/sync/profile_sync_service.h"
35 #include "chrome/browser/sync/profile_sync_service_factory.h"
35 #include "chrome/browser/ui/browser.h" 36 #include "chrome/browser/ui/browser.h"
36 #include "chrome/browser/ui/browser_list.h" 37 #include "chrome/browser/ui/browser_list.h"
37 #include "chrome/browser/ui/browser_window.h" 38 #include "chrome/browser/ui/browser_window.h"
38 #include "chrome/common/chrome_notification_types.h" 39 #include "chrome/common/chrome_notification_types.h"
39 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
40 #include "content/public/browser/browser_thread.h" 41 #include "content/public/browser/browser_thread.h"
41 #include "content/public/browser/notification_service.h" 42 #include "content/public/browser/notification_service.h"
42 #include "content/public/browser/user_metrics.h" 43 #include "content/public/browser/user_metrics.h"
43 #include "googleurl/src/gurl.h" 44 #include "googleurl/src/gurl.h"
44 #include "grit/generated_resources.h" 45 #include "grit/generated_resources.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (!username.empty()) 258 if (!username.empty())
258 LOG(WARNING) << "authentication_start_time_ is not set"; 259 LOG(WARNING) << "authentication_start_time_ is not set";
259 } else { 260 } else {
260 base::TimeDelta delta = base::Time::Now() - authentication_start_time_; 261 base::TimeDelta delta = base::Time::Now() - authentication_start_time_;
261 VLOG(1) << "Authentication success time: " << delta.InSecondsF(); 262 VLOG(1) << "Authentication success time: " << delta.InSecondsF();
262 UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta); 263 UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta);
263 } 264 }
264 265
265 Profile* profile = ProfileManager::GetDefaultProfile(); 266 Profile* profile = ProfileManager::GetDefaultProfile();
266 if (profile) { 267 if (profile) {
267 ProfileSyncService* service = profile->GetProfileSyncService(); 268 ProfileSyncService* service(
269 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile));
268 if (service && !service->HasSyncSetupCompleted()) { 270 if (service && !service->HasSyncSetupCompleted()) {
269 // If sync has failed somehow, try setting the sync passphrase here. 271 // If sync has failed somehow, try setting the sync passphrase here.
270 service->SetPassphrase(password, false); 272 service->SetPassphrase(password, false);
271 } 273 }
272 } 274 }
273 DBusThreadManager::Get()->GetPowerManagerClient()-> 275 DBusThreadManager::Get()->GetPowerManagerClient()->
274 NotifyScreenUnlockRequested(); 276 NotifyScreenUnlockRequested();
275 277
276 if (login_status_consumer_) 278 if (login_status_consumer_)
277 login_status_consumer_->OnLoginSuccess(username, password, 279 login_status_consumer_->OnLoginSuccess(username, password,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 bool state = true; 440 bool state = true;
439 content::NotificationService::current()->Notify( 441 content::NotificationService::current()->Notify(
440 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, 442 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
441 content::Source<ScreenLocker>(this), 443 content::Source<ScreenLocker>(this),
442 content::Details<bool>(&state)); 444 content::Details<bool>(&state));
443 DBusThreadManager::Get()->GetPowerManagerClient()-> 445 DBusThreadManager::Get()->GetPowerManagerClient()->
444 NotifyScreenLockCompleted(); 446 NotifyScreenLockCompleted();
445 } 447 }
446 448
447 } // namespace chromeos 449 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/extensions/app_notify_channel_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698