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

Side by Side Diff: chrome/browser/signin/signin_manager_fake.cc

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows sync integration test failure Created 7 years, 10 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 | « chrome/browser/signin/signin_manager_fake.h ('k') | chrome/browser/signin/signin_tracker.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 (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/signin/signin_manager_fake.h" 5 #include "chrome/browser/signin/signin_manager_fake.h"
6 6
7 #include "chrome/browser/signin/signin_global_error.h" 7 #include "chrome/browser/signin/signin_global_error.h"
8 #include "chrome/browser/ui/global_error/global_error_service.h" 8 #include "chrome/browser/ui/global_error/global_error_service.h"
9 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 9 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
11 #include "content/public/browser/notification_service.h" 11 #include "content/public/browser/notification_service.h"
12 12
13 FakeSigninManager::FakeSigninManager(Profile* profile) { 13 FakeSigninManager::FakeSigninManager(Profile* profile)
14 : auth_in_progress_(false) {
14 profile_ = profile; 15 profile_ = profile;
15 signin_global_error_.reset(new SigninGlobalError(profile)); 16 signin_global_error_.reset(new SigninGlobalError(this, profile));
16 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError( 17 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError(
17 signin_global_error_.get()); 18 signin_global_error_.get());
18 } 19 }
19 20
20 FakeSigninManager::~FakeSigninManager() { 21 FakeSigninManager::~FakeSigninManager() {
21 if (signin_global_error_.get()) { 22 if (signin_global_error_.get()) {
22 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError( 23 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError(
23 signin_global_error_.get()); 24 signin_global_error_.get());
24 signin_global_error_.reset(); 25 signin_global_error_.reset();
25 } 26 }
(...skipping 19 matching lines...) Expand all
45 } 46 }
46 47
47 void FakeSigninManager::SignOut() { 48 void FakeSigninManager::SignOut() {
48 authenticated_username_.clear(); 49 authenticated_username_.clear();
49 content::NotificationService::current()->Notify( 50 content::NotificationService::current()->Notify(
50 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, 51 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT,
51 content::Source<Profile>(profile_), 52 content::Source<Profile>(profile_),
52 content::NotificationService::NoDetails()); 53 content::NotificationService::NoDetails());
53 } 54 }
54 55
56 bool FakeSigninManager::AuthInProgress() const {
57 return auth_in_progress_;
58 }
59
55 // static 60 // static
56 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) { 61 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) {
57 return new FakeSigninManager(profile); 62 return new FakeSigninManager(profile);
58 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager_fake.h ('k') | chrome/browser/signin/signin_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698