| 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/ui/chrome_pages.h" | 5 #include "chrome/browser/ui/chrome_pages.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 void ShowSearchEngineSettings(Browser* browser) { | 179 void ShowSearchEngineSettings(Browser* browser) { |
| 180 content::RecordAction(UserMetricsAction("EditSearchEngines")); | 180 content::RecordAction(UserMetricsAction("EditSearchEngines")); |
| 181 ShowSettingsSubPage(browser, kSearchEnginesSubPage); | 181 ShowSettingsSubPage(browser, kSearchEnginesSubPage); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) { | 184 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) { |
| 185 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 185 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
| 186 SigninManager* manager = | 186 SigninManager* manager = |
| 187 SigninManagerFactory::GetForProfile(original_profile); | 187 SigninManagerFactory::GetForProfile(original_profile); |
| 188 DCHECK(manager->IsSigninAllowed()); |
| 188 // If we're signed in, just show settings. | 189 // If we're signed in, just show settings. |
| 189 if (!manager->GetAuthenticatedUsername().empty()) { | 190 if (!manager->GetAuthenticatedUsername().empty()) { |
| 190 ShowSettings(browser); | 191 ShowSettings(browser); |
| 191 } else { | 192 } else { |
| 192 // If the browser's profile is an incognito profile, make sure to use | 193 // If the browser's profile is an incognito profile, make sure to use |
| 193 // a browser window from the original profile. The user cannot sign in | 194 // a browser window from the original profile. The user cannot sign in |
| 194 // from an incognito window. | 195 // from an incognito window. |
| 195 if (browser->profile()->IsOffTheRecord()) { | 196 if (browser->profile()->IsOffTheRecord()) { |
| 196 browser = | 197 browser = |
| 197 chrome::FindOrCreateTabbedBrowser(original_profile, | 198 chrome::FindOrCreateTabbedBrowser(original_profile, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 228 const std::string& service, | 229 const std::string& service, |
| 229 const GURL& continue_url) { | 230 const GURL& continue_url) { |
| 230 GURL url(GaiaUrls::GetInstance()->service_login_url()); | 231 GURL url(GaiaUrls::GetInstance()->service_login_url()); |
| 231 url = net::AppendQueryParameter(url, "service", service); | 232 url = net::AppendQueryParameter(url, "service", service); |
| 232 if (continue_url.is_valid()) | 233 if (continue_url.is_valid()) |
| 233 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); | 234 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); |
| 234 NavigateToSingletonTab(browser, url); | 235 NavigateToSingletonTab(browser, url); |
| 235 } | 236 } |
| 236 | 237 |
| 237 } // namespace chrome | 238 } // namespace chrome |
| OLD | NEW |