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/webui/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_window.h" | 10 #include "apps/app_window.h" |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 void BrowserOptionsHandler::OnWallpaperManagedChanged(bool managed) { | 1318 void BrowserOptionsHandler::OnWallpaperManagedChanged(bool managed) { |
1319 web_ui()->CallJavascriptFunction("BrowserOptions.setWallpaperManaged", | 1319 web_ui()->CallJavascriptFunction("BrowserOptions.setWallpaperManaged", |
1320 base::FundamentalValue(managed)); | 1320 base::FundamentalValue(managed)); |
1321 } | 1321 } |
1322 #endif | 1322 #endif |
1323 | 1323 |
1324 scoped_ptr<base::DictionaryValue> | 1324 scoped_ptr<base::DictionaryValue> |
1325 BrowserOptionsHandler::GetSyncStateDictionary() { | 1325 BrowserOptionsHandler::GetSyncStateDictionary() { |
1326 scoped_ptr<base::DictionaryValue> sync_status(new base::DictionaryValue); | 1326 scoped_ptr<base::DictionaryValue> sync_status(new base::DictionaryValue); |
1327 Profile* profile = Profile::FromWebUI(web_ui()); | 1327 Profile* profile = Profile::FromWebUI(web_ui()); |
1328 if (profile->IsManaged()) { | |
1329 sync_status->SetBoolean("supervisedUser", true); | |
1330 sync_status->SetBoolean("signinAllowed", false); | |
1331 return sync_status.Pass(); | |
1332 } | |
1333 if (profile->IsGuestSession()) { | 1328 if (profile->IsGuestSession()) { |
1334 // Cannot display signin status when running in guest mode on chromeos | 1329 // Cannot display signin status when running in guest mode on chromeos |
1335 // because there is no SigninManager. | 1330 // because there is no SigninManager. |
1336 sync_status->SetBoolean("signinAllowed", false); | 1331 sync_status->SetBoolean("signinAllowed", false); |
1337 return sync_status.Pass(); | 1332 return sync_status.Pass(); |
1338 } | 1333 } |
1339 sync_status->SetBoolean("supervisedUser", false); | 1334 |
| 1335 sync_status->SetBoolean("supervisedUser", profile->IsManaged()); |
1340 | 1336 |
1341 bool signout_prohibited = false; | 1337 bool signout_prohibited = false; |
1342 #if !defined(OS_CHROMEOS) | 1338 #if !defined(OS_CHROMEOS) |
1343 // Signout is not allowed if the user has policy (crbug.com/172204). | 1339 // Signout is not allowed if the user has policy (crbug.com/172204). |
1344 signout_prohibited = | 1340 signout_prohibited = |
1345 SigninManagerFactory::GetForProfile(profile)->IsSignoutProhibited(); | 1341 SigninManagerFactory::GetForProfile(profile)->IsSignoutProhibited(); |
1346 #endif | 1342 #endif |
1347 | 1343 |
1348 ProfileSyncService* service = | 1344 ProfileSyncService* service = |
1349 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 1345 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 ExtensionRegistry::ENABLED); | 1781 ExtensionRegistry::ENABLED); |
1786 } | 1782 } |
1787 AppendExtensionData("newTabPage", extension, &extension_controlled); | 1783 AppendExtensionData("newTabPage", extension, &extension_controlled); |
1788 | 1784 |
1789 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1785 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
1790 extension_controlled); | 1786 extension_controlled); |
1791 #endif // defined(OS_WIN) | 1787 #endif // defined(OS_WIN) |
1792 } | 1788 } |
1793 | 1789 |
1794 } // namespace options | 1790 } // namespace options |
OLD | NEW |