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

Side by Side Diff: chrome/browser/policy/browser_policy_connector.cc

Issue 12300016: Ignoring the timezone policy if it is set to an empty string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch. 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/policy/browser_policy_connector.h" 5 #include "chrome/browser/policy/browser_policy_connector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 typedef chromeos::CrosSettingsProvider Provider; 467 typedef chromeos::CrosSettingsProvider Provider;
468 Provider::TrustedStatus result = 468 Provider::TrustedStatus result =
469 chromeos::CrosSettings::Get()->PrepareTrustedValues( 469 chromeos::CrosSettings::Get()->PrepareTrustedValues(
470 base::Bind(&BrowserPolicyConnector::SetTimezoneIfPolicyAvailable, 470 base::Bind(&BrowserPolicyConnector::SetTimezoneIfPolicyAvailable,
471 weak_ptr_factory_.GetWeakPtr())); 471 weak_ptr_factory_.GetWeakPtr()));
472 472
473 if (result != Provider::TRUSTED) 473 if (result != Provider::TRUSTED)
474 return; 474 return;
475 475
476 std::string timezone; 476 std::string timezone;
477 if (chromeos::CrosSettings::Get()->GetString( 477 if (chromeos::CrosSettings::Get()->GetString(chromeos::kSystemTimezonePolicy,
478 chromeos::kSystemTimezonePolicy, &timezone)) { 478 &timezone) &&
479 !timezone.empty()) {
479 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( 480 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
480 UTF8ToUTF16(timezone)); 481 UTF8ToUTF16(timezone));
481 } 482 }
482 #endif 483 #endif
483 } 484 }
484 485
485 scoped_ptr<PolicyService> 486 scoped_ptr<PolicyService>
486 BrowserPolicyConnector::CreatePolicyServiceWithProviders( 487 BrowserPolicyConnector::CreatePolicyServiceWithProviders(
487 ConfigurationPolicyProvider* user_cloud_policy_provider, 488 ConfigurationPolicyProvider* user_cloud_policy_provider,
488 ConfigurationPolicyProvider* managed_mode_policy_provider) { 489 ConfigurationPolicyProvider* managed_mode_policy_provider) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 return new AsyncPolicyProvider(loader.Pass()); 532 return new AsyncPolicyProvider(loader.Pass());
532 } else { 533 } else {
533 return NULL; 534 return NULL;
534 } 535 }
535 #else 536 #else
536 return NULL; 537 return NULL;
537 #endif 538 #endif
538 } 539 }
539 540
540 } // namespace policy 541 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/policy/proto/chrome_device_policy.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698