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

Side by Side Diff: chrome/browser/chromeos/policy/enterprise_install_attributes.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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
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/chromeos/policy/enterprise_install_attributes.h" 5 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void EnterpriseInstallAttributes::ReadAttributesIfReady( 114 void EnterpriseInstallAttributes::ReadAttributesIfReady(
115 const base::Closure& callback, 115 const base::Closure& callback,
116 chromeos::DBusMethodCallStatus call_status, 116 chromeos::DBusMethodCallStatus call_status,
117 bool result) { 117 bool result) {
118 if (call_status == chromeos::DBUS_METHOD_CALL_SUCCESS && result) { 118 if (call_status == chromeos::DBUS_METHOD_CALL_SUCCESS && result) {
119 registration_mode_ = DEVICE_MODE_NOT_SET; 119 registration_mode_ = DEVICE_MODE_NOT_SET;
120 if (!cryptohome_util::InstallAttributesIsInvalid() && 120 if (!cryptohome_util::InstallAttributesIsInvalid() &&
121 !cryptohome_util::InstallAttributesIsFirstInstall()) { 121 !cryptohome_util::InstallAttributesIsFirstInstall()) {
122 device_locked_ = true; 122 device_locked_ = true;
123 123
124 static const char* kEnterpriseAttributes[] = { 124 static const char* const kEnterpriseAttributes[] = {
125 kAttrEnterpriseDeviceId, 125 kAttrEnterpriseDeviceId,
126 kAttrEnterpriseDomain, 126 kAttrEnterpriseDomain,
127 kAttrEnterpriseMode, 127 kAttrEnterpriseMode,
128 kAttrEnterpriseOwned, 128 kAttrEnterpriseOwned,
129 kAttrEnterpriseUser, 129 kAttrEnterpriseUser,
130 kAttrConsumerKioskEnabled, 130 kAttrConsumerKioskEnabled,
131 }; 131 };
132 std::map<std::string, std::string> attr_map; 132 std::map<std::string, std::string> attr_map;
133 for (size_t i = 0; i < arraysize(kEnterpriseAttributes); ++i) { 133 for (size_t i = 0; i < arraysize(kEnterpriseAttributes); ++i) {
134 std::string value; 134 std::string value;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 &consumer_kiosk_enabled) && 387 &consumer_kiosk_enabled) &&
388 consumer_kiosk_enabled == "true") { 388 consumer_kiosk_enabled == "true") {
389 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; 389 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH;
390 } else if (enterprise_user.empty() && enterprise_owned != "true") { 390 } else if (enterprise_user.empty() && enterprise_owned != "true") {
391 // |registration_user_| is empty on consumer devices. 391 // |registration_user_| is empty on consumer devices.
392 registration_mode_ = DEVICE_MODE_CONSUMER; 392 registration_mode_ = DEVICE_MODE_CONSUMER;
393 } 393 }
394 } 394 }
395 395
396 } // namespace policy 396 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698