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

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

Issue 9668001: Add a new policy to allow for release channel delegation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and added the policy to the about:policy. Created 8 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/policy/device_policy_cache.h" 5 #include "chrome/browser/policy/device_policy_cache.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 399
400 if (policy.has_metrics_enabled()) { 400 if (policy.has_metrics_enabled()) {
401 const em::MetricsEnabledProto& container(policy.metrics_enabled()); 401 const em::MetricsEnabledProto& container(policy.metrics_enabled());
402 if (container.has_metrics_enabled()) { 402 if (container.has_metrics_enabled()) {
403 policies->Set(key::kDeviceMetricsReportingEnabled, POLICY_LEVEL_MANDATORY, 403 policies->Set(key::kDeviceMetricsReportingEnabled, POLICY_LEVEL_MANDATORY,
404 POLICY_SCOPE_MACHINE, 404 POLICY_SCOPE_MACHINE,
405 Value::CreateBooleanValue(container.metrics_enabled())); 405 Value::CreateBooleanValue(container.metrics_enabled()));
406 } 406 }
407 } 407 }
408 408
409 if (policy.has_release_channel() && 409 if (policy.has_release_channel()) {
410 policy.release_channel().has_release_channel()) { 410 const em::ReleaseChannelProto& container(policy.release_channel());
411 std::string channel(policy.release_channel().release_channel()); 411 if (container.has_release_channel()) {
412 policies->Set(key::kChromeOsReleaseChannel, POLICY_LEVEL_MANDATORY, 412 std::string channel(container.release_channel());
413 POLICY_SCOPE_MACHINE, Value::CreateStringValue(channel)); 413 policies->Set(key::kChromeOsReleaseChannel, POLICY_LEVEL_MANDATORY,
414 // TODO(dubroy): Once http://crosbug.com/17015 is implemented, we won't 414 POLICY_SCOPE_MACHINE, Value::CreateStringValue(channel));
415 // have to pass the channel in here, only ping the update engine to tell 415 // TODO(dubroy): Once http://crosbug.com/17015 is implemented, we won't
416 // it to fetch the channel from the policy. 416 // have to pass the channel in here, only ping the update engine to tell
417 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient() 417 // it to fetch the channel from the policy.
418 ->SetReleaseTrack(channel); 418 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()->
419 SetReleaseTrack(channel);
420 }
421 if (container.has_release_channel_delegated()) {
422 policies->Set(key::kDeviceMetricsReportingEnabled,
Joao da Silva 2012/03/12 15:12:01 Wrong key.
pastarmovj 2012/03/13 15:03:29 Done.
423 POLICY_LEVEL_MANDATORY,
424 POLICY_SCOPE_MACHINE,
425 Value::CreateBooleanValue(
426 container.release_channel_delegated()));
427 }
419 } 428 }
420 429
421 if (policy.has_open_network_configuration() && 430 if (policy.has_open_network_configuration() &&
422 policy.open_network_configuration().has_open_network_configuration()) { 431 policy.open_network_configuration().has_open_network_configuration()) {
423 std::string config( 432 std::string config(
424 policy.open_network_configuration().open_network_configuration()); 433 policy.open_network_configuration().open_network_configuration());
425 policies->Set(key::kDeviceOpenNetworkConfiguration, POLICY_LEVEL_MANDATORY, 434 policies->Set(key::kDeviceOpenNetworkConfiguration, POLICY_LEVEL_MANDATORY,
426 POLICY_SCOPE_MACHINE, Value::CreateStringValue(config)); 435 POLICY_SCOPE_MACHINE, Value::CreateStringValue(config));
427 } 436 }
428 437
(...skipping 23 matching lines...) Expand all
452 if (container.has_ephemeral_users_enabled()) { 461 if (container.has_ephemeral_users_enabled()) {
453 policies->Set(key::kDeviceEphemeralUsersEnabled, POLICY_LEVEL_MANDATORY, 462 policies->Set(key::kDeviceEphemeralUsersEnabled, POLICY_LEVEL_MANDATORY,
454 POLICY_SCOPE_MACHINE, 463 POLICY_SCOPE_MACHINE,
455 Value::CreateBooleanValue( 464 Value::CreateBooleanValue(
456 container.ephemeral_users_enabled())); 465 container.ephemeral_users_enabled()));
457 } 466 }
458 } 467 }
459 } 468 }
460 469
461 } // namespace policy 470 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/device_settings_provider.cc ('k') | chrome/browser/policy/proto/chrome_device_policy.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698