OLD | NEW |
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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Increase logging level for Guest mode to avoid LOG(INFO) messages in logs. | 101 // Increase logging level for Guest mode to avoid LOG(INFO) messages in logs. |
102 const char kGuestModeLoggingLevel[] = "1"; | 102 const char kGuestModeLoggingLevel[] = "1"; |
103 | 103 |
104 // Format of command line switch. | 104 // Format of command line switch. |
105 const char kSwitchFormatString[] = " --%s=\"%s\""; | 105 const char kSwitchFormatString[] = " --%s=\"%s\""; |
106 | 106 |
107 // User name which is used in the Guest session. | 107 // User name which is used in the Guest session. |
108 const char kGuestUserName[] = ""; | 108 const char kGuestUserName[] = ""; |
109 | 109 |
110 // TODO(zelidrag): Figure out if we need to add more services here. | |
111 const char kServiceScopeChromeOSDocuments[] = | |
112 "https://docs.google.com/feeds/ " | |
113 "https://spreadsheets.google.com/feeds/ " | |
114 "https://docs.googleusercontent.com/"; | |
115 | |
116 class InitializeCookieMonsterHelper { | 110 class InitializeCookieMonsterHelper { |
117 public: | 111 public: |
118 explicit InitializeCookieMonsterHelper( | 112 explicit InitializeCookieMonsterHelper( |
119 net::URLRequestContextGetter* new_context) | 113 net::URLRequestContextGetter* new_context) |
120 : ALLOW_THIS_IN_INITIALIZER_LIST(callback_(base::Bind( | 114 : ALLOW_THIS_IN_INITIALIZER_LIST(callback_(base::Bind( |
121 &InitializeCookieMonsterHelper::InitializeCookieMonster, | 115 &InitializeCookieMonsterHelper::InitializeCookieMonster, |
122 base::Unretained(this)))), | 116 base::Unretained(this)))), |
123 new_context_(new_context) { | 117 new_context_(new_context) { |
124 } | 118 } |
125 | 119 |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 bool LoginUtils::IsWhitelisted(const std::string& username) { | 1116 bool LoginUtils::IsWhitelisted(const std::string& username) { |
1123 CrosSettings* cros_settings = CrosSettings::Get(); | 1117 CrosSettings* cros_settings = CrosSettings::Get(); |
1124 bool allow_new_user = false; | 1118 bool allow_new_user = false; |
1125 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1119 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
1126 if (allow_new_user) | 1120 if (allow_new_user) |
1127 return true; | 1121 return true; |
1128 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 1122 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
1129 } | 1123 } |
1130 | 1124 |
1131 } // namespace chromeos | 1125 } // namespace chromeos |
OLD | NEW |