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

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: Extract managed user specific stuff into another changelist. Created 7 years, 10 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/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.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
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 // Check if Signin to Chrome is allowed by the policy.
189 if (!manager->IsSigninAllowed())
sail 2013/02/08 20:18:57 Why would this code be reached if signin is not al
Adrian Kuegel 2013/02/11 16:47:30 Yes, I agree this code should never be reached if
sail 2013/02/20 23:08:21 DCHECK is fine.
190 return;
188 // If we're signed in, just show settings. 191 // If we're signed in, just show settings.
189 if (!manager->GetAuthenticatedUsername().empty()) { 192 if (!manager->GetAuthenticatedUsername().empty()) {
190 ShowSettings(browser); 193 ShowSettings(browser);
191 } else { 194 } else {
192 // If the browser's profile is an incognito profile, make sure to use 195 // 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 196 // a browser window from the original profile. The user cannot sign in
194 // from an incognito window. 197 // from an incognito window.
195 if (browser->profile()->IsOffTheRecord()) { 198 if (browser->profile()->IsOffTheRecord()) {
196 browser = 199 browser =
197 chrome::FindOrCreateTabbedBrowser(original_profile, 200 chrome::FindOrCreateTabbedBrowser(original_profile,
(...skipping 30 matching lines...) Expand all
228 const std::string& service, 231 const std::string& service,
229 const GURL& continue_url) { 232 const GURL& continue_url) {
230 GURL url(GaiaUrls::GetInstance()->service_login_url()); 233 GURL url(GaiaUrls::GetInstance()->service_login_url());
231 url = net::AppendQueryParameter(url, "service", service); 234 url = net::AppendQueryParameter(url, "service", service);
232 if (continue_url.is_valid()) 235 if (continue_url.is_valid())
233 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); 236 url = net::AppendQueryParameter(url, "continue", continue_url.spec());
234 NavigateToSingletonTab(browser, url); 237 NavigateToSingletonTab(browser, url);
235 } 238 }
236 239
237 } // namespace chrome 240 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698