| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 base::StringAppendF(&url, "?%s=%d", option, value); | 172 base::StringAppendF(&url, "?%s=%d", option, value); |
| 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 DCHECK_NE(SOURCE_UNKNOWN, source); | 177 DCHECK_NE(SOURCE_UNKNOWN, source); |
| 178 | 178 |
| 179 bool enable_inline = CommandLine::ForCurrentProcess()->HasSwitch( | 179 bool enable_inline = CommandLine::ForCurrentProcess()->HasSwitch( |
| 180 switches::kEnableInlineSignin); | 180 switches::kEnableInlineSignin); |
| 181 if (enable_inline) { | 181 if (enable_inline) { |
| 182 std::string url(chrome::kChromeUIInlineLoginURL); | 182 std::string url(chrome::kChromeUIChromeSigninURL); |
| 183 base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source); | 183 base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source); |
| 184 if (auto_close) | 184 if (auto_close) |
| 185 base::StringAppendF( | 185 base::StringAppendF( |
| 186 &url, "&%s=1", kSignInPromoQueryKeyAutoClose); | 186 &url, "&%s=1", kSignInPromoQueryKeyAutoClose); |
| 187 return GURL(url); | 187 return GURL(url); |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Build a Gaia-based URL that can be used to sign the user into chrome. | 190 // Build a Gaia-based URL that can be used to sign the user into chrome. |
| 191 // There are required request parameters: | 191 // There are required request parameters: |
| 192 // | 192 // |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 prefs::kSignInPromoShowOnFirstRunAllowed, | 271 prefs::kSignInPromoShowOnFirstRunAllowed, |
| 272 true, | 272 true, |
| 273 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 273 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 274 registry->RegisterBooleanPref( | 274 registry->RegisterBooleanPref( |
| 275 prefs::kSignInPromoShowNTPBubble, | 275 prefs::kSignInPromoShowNTPBubble, |
| 276 false, | 276 false, |
| 277 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 277 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace signin | 280 } // namespace signin |
| OLD | NEW |