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