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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 2031303003: ChromeOS: enable SystemTimezoneAutomaticDetectionPolicy by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment updated. Created 4 years, 6 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
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chromeos/chromeos_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 base::FundamentalValue(managed)); 1457 base::FundamentalValue(managed));
1458 } 1458 }
1459 1459
1460 void BrowserOptionsHandler::OnSystemTimezonePolicyChanged() { 1460 void BrowserOptionsHandler::OnSystemTimezonePolicyChanged() {
1461 web_ui()->CallJavascriptFunction( 1461 web_ui()->CallJavascriptFunction(
1462 "BrowserOptions.setSystemTimezoneManaged", 1462 "BrowserOptions.setSystemTimezoneManaged",
1463 base::FundamentalValue(chromeos::system::HasSystemTimezonePolicy())); 1463 base::FundamentalValue(chromeos::system::HasSystemTimezonePolicy()));
1464 } 1464 }
1465 1465
1466 void BrowserOptionsHandler::OnSystemTimezoneAutomaticDetectionPolicyChanged() { 1466 void BrowserOptionsHandler::OnSystemTimezoneAutomaticDetectionPolicyChanged() {
1467 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1467 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1468 chromeos::switches::kEnableSystemTimezoneAutomaticDetectionPolicy)) { 1468 chromeos::switches::kDisableSystemTimezoneAutomaticDetectionPolicy)) {
1469 return; 1469 return;
1470 } 1470 }
1471 1471
1472 PrefService* prefs = g_browser_process->local_state(); 1472 PrefService* prefs = g_browser_process->local_state();
1473 const bool is_managed = prefs->IsManagedPreference( 1473 const bool is_managed = prefs->IsManagedPreference(
1474 prefs::kSystemTimezoneAutomaticDetectionPolicy); 1474 prefs::kSystemTimezoneAutomaticDetectionPolicy);
1475 const int value = 1475 const int value =
1476 prefs->GetInteger(prefs::kSystemTimezoneAutomaticDetectionPolicy); 1476 prefs->GetInteger(prefs::kSystemTimezoneAutomaticDetectionPolicy);
1477 web_ui()->CallJavascriptFunction( 1477 web_ui()->CallJavascriptFunction(
1478 "BrowserOptions.setSystemTimezoneAutomaticDetectionManaged", 1478 "BrowserOptions.setSystemTimezoneAutomaticDetectionManaged",
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 2179
2180 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2180 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2181 #if defined(OS_CHROMEOS) 2181 #if defined(OS_CHROMEOS)
2182 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2182 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2183 #else 2183 #else
2184 return true; 2184 return true;
2185 #endif 2185 #endif
2186 } 2186 }
2187 2187
2188 } // namespace options 2188 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chromeos/chromeos_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698