| OLD | NEW |
| 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/signin/signin_promo.h" | 5 #include "chrome/browser/signin/signin_promo.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return GURL(url); | 174 return GURL(url); |
| 175 } | 175 } |
| 176 | 176 |
| 177 GURL GetPromoURL(Source source, bool auto_close) { | 177 GURL GetPromoURL(Source source, bool auto_close) { |
| 178 return GetPromoURL(source, auto_close, false /* is_constrained */); | 178 return GetPromoURL(source, auto_close, false /* is_constrained */); |
| 179 } | 179 } |
| 180 | 180 |
| 181 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained) { | 181 GURL GetPromoURL(Source source, bool auto_close, bool is_constrained) { |
| 182 DCHECK_NE(SOURCE_UNKNOWN, source); | 182 DCHECK_NE(SOURCE_UNKNOWN, source); |
| 183 | 183 |
| 184 bool enable_inline = CommandLine::ForCurrentProcess()->HasSwitch( | 184 bool enable_web_flow = CommandLine::ForCurrentProcess()->HasSwitch( |
| 185 switches::kEnableInlineSignin); | 185 switches::kEnableWebBasedSignin); |
| 186 if (enable_inline) { | 186 if (!enable_web_flow) { |
| 187 std::string url(chrome::kChromeUIChromeSigninURL); | 187 std::string url(chrome::kChromeUIChromeSigninURL); |
| 188 base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source); | 188 base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source); |
| 189 if (auto_close) | 189 if (auto_close) |
| 190 base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyAutoClose); | 190 base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyAutoClose); |
| 191 if (is_constrained) | 191 if (is_constrained) |
| 192 base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyConstrained); | 192 base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyConstrained); |
| 193 return GURL(url); | 193 return GURL(url); |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Build a Gaia-based URL that can be used to sign the user into chrome. | 196 // Build a Gaia-based URL that can be used to sign the user into chrome. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 prefs::kSignInPromoShowOnFirstRunAllowed, | 277 prefs::kSignInPromoShowOnFirstRunAllowed, |
| 278 true, | 278 true, |
| 279 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 279 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 280 registry->RegisterBooleanPref( | 280 registry->RegisterBooleanPref( |
| 281 prefs::kSignInPromoShowNTPBubble, | 281 prefs::kSignInPromoShowNTPBubble, |
| 282 false, | 282 false, |
| 283 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 283 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace signin | 286 } // namespace signin |
| OLD | NEW |