| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 ShowSingletonTabOverwritingNTP(browser, params); | 185 ShowSingletonTabOverwritingNTP(browser, params); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void ShowSearchEngineSettings(Browser* browser) { | 188 void ShowSearchEngineSettings(Browser* browser) { |
| 189 content::RecordAction(UserMetricsAction("EditSearchEngines")); | 189 content::RecordAction(UserMetricsAction("EditSearchEngines")); |
| 190 ShowSettingsSubPage(browser, kSearchEnginesSubPage); | 190 ShowSettingsSubPage(browser, kSearchEnginesSubPage); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) { | 193 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) { |
| 194 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 194 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
| 195 SigninManager* manager = | 195 SigninManagerBase* manager = |
| 196 SigninManagerFactory::GetForProfile(original_profile); | 196 SigninManagerFactory::GetForProfile(original_profile); |
| 197 DCHECK(manager->IsSigninAllowed()); | 197 DCHECK(manager->IsSigninAllowed()); |
| 198 // If we're signed in, just show settings. | 198 // If we're signed in, just show settings. |
| 199 if (!manager->GetAuthenticatedUsername().empty()) { | 199 if (!manager->GetAuthenticatedUsername().empty()) { |
| 200 ShowSettings(browser); | 200 ShowSettings(browser); |
| 201 } else { | 201 } else { |
| 202 // If the browser's profile is an incognito profile, make sure to use | 202 // If the browser's profile is an incognito profile, make sure to use |
| 203 // a browser window from the original profile. The user cannot sign in | 203 // a browser window from the original profile. The user cannot sign in |
| 204 // from an incognito window. | 204 // from an incognito window. |
| 205 if (browser->profile()->IsOffTheRecord()) { | 205 if (browser->profile()->IsOffTheRecord()) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 const std::string& service, | 238 const std::string& service, |
| 239 const GURL& continue_url) { | 239 const GURL& continue_url) { |
| 240 GURL url(GaiaUrls::GetInstance()->service_login_url()); | 240 GURL url(GaiaUrls::GetInstance()->service_login_url()); |
| 241 url = net::AppendQueryParameter(url, "service", service); | 241 url = net::AppendQueryParameter(url, "service", service); |
| 242 if (continue_url.is_valid()) | 242 if (continue_url.is_valid()) |
| 243 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); | 243 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); |
| 244 NavigateToSingletonTab(browser, url); | 244 NavigateToSingletonTab(browser, url); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace chrome | 247 } // namespace chrome |
| OLD | NEW |