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

Side by Side Diff: chrome/browser/chromeos/profiles/profile_util.cc

Issue 218903005: Make push messaging not create InvalidationService for login and guest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make code resilient against tests that do not create the Default profile first. Created 6 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/profiles/profile_util.h" 5 #include "chrome/browser/chromeos/profiles/profile_util.h"
6 6
7 #include "base/files/file_path.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
7 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
8 #include "chromeos/login/login_state.h" 10 #include "chromeos/login/login_state.h"
9 11
10 namespace chromeos { 12 namespace chromeos {
11 13
12 bool IsProfileAssociatedWithGaiaAccount(Profile* profile) { 14 bool IsProfileAssociatedWithGaiaAccount(Profile* profile) {
13 if (!chromeos::LoginState::IsInitialized()) 15 if (!chromeos::LoginState::IsInitialized())
14 return false; 16 return false;
15 if (!chromeos::LoginState::Get()->IsUserGaiaAuthenticated()) 17 if (!chromeos::LoginState::Get()->IsUserGaiaAuthenticated())
16 return false; 18 return false;
17 if (profile->IsOffTheRecord()) 19 if (profile->IsOffTheRecord())
18 return false; 20 return false;
21
22 // Using ProfileHelper::GetSigninProfile() here would lead to an infinite loop
23 // when this method is called during the creation of the sign-in profile
24 // itself. Using ProfileHelper::GetSigninProfileDir() is safe because it does
25 // not try to access the sign-in profile.
26 if (profile->GetPath() == ProfileHelper::GetSigninProfileDir())
27 return false;
19 return true; 28 return true;
20 } 29 }
21 30
22 } // namespace chromeos 31 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/profiles/profile_helper.cc ('k') | chrome/browser/extensions/api/push_messaging/push_messaging_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698