Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/ui/chrome_pages.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits and rebase to ToT. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 void ShowSearchEngineSettings(Browser* browser) { 194 void ShowSearchEngineSettings(Browser* browser) {
195 content::RecordAction(UserMetricsAction("EditSearchEngines")); 195 content::RecordAction(UserMetricsAction("EditSearchEngines"));
196 ShowSettingsSubPage(browser, kSearchEnginesSubPage); 196 ShowSettingsSubPage(browser, kSearchEnginesSubPage);
197 } 197 }
198 198
199 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) { 199 void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) {
200 Profile* original_profile = browser->profile()->GetOriginalProfile(); 200 Profile* original_profile = browser->profile()->GetOriginalProfile();
201 SigninManager* manager = 201 SigninManager* manager =
202 SigninManagerFactory::GetForProfile(original_profile); 202 SigninManagerFactory::GetForProfile(original_profile);
203 DCHECK(manager->IsSigninAllowed());
203 // If we're signed in, just show settings. 204 // If we're signed in, just show settings.
204 if (!manager->GetAuthenticatedUsername().empty()) { 205 if (!manager->GetAuthenticatedUsername().empty()) {
205 ShowSettings(browser); 206 ShowSettings(browser);
206 } else { 207 } else {
207 // If the browser's profile is an incognito profile, make sure to use 208 // If the browser's profile is an incognito profile, make sure to use
208 // a browser window from the original profile. The user cannot sign in 209 // a browser window from the original profile. The user cannot sign in
209 // from an incognito window. 210 // from an incognito window.
210 if (browser->profile()->IsOffTheRecord()) { 211 if (browser->profile()->IsOffTheRecord()) {
211 browser = 212 browser =
212 chrome::FindOrCreateTabbedBrowser(original_profile, 213 chrome::FindOrCreateTabbedBrowser(original_profile,
(...skipping 30 matching lines...) Expand all
243 const std::string& service, 244 const std::string& service,
244 const GURL& continue_url) { 245 const GURL& continue_url) {
245 GURL url(GaiaUrls::GetInstance()->service_login_url()); 246 GURL url(GaiaUrls::GetInstance()->service_login_url());
246 url = net::AppendQueryParameter(url, "service", service); 247 url = net::AppendQueryParameter(url, "service", service);
247 if (continue_url.is_valid()) 248 if (continue_url.is_valid())
248 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); 249 url = net::AppendQueryParameter(url, "continue", continue_url.spec());
249 NavigateToSingletonTab(browser, url); 250 NavigateToSingletonTab(browser, url);
250 } 251 }
251 252
252 } // namespace chrome 253 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_command_controller_unittest.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698