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

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

Issue 10542072: Chrome OS: Update serial number key priority. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // on startup. (So that displaying Chrome's GUI does not get delayed.) 67 // on startup. (So that displaying Chrome's GUI does not get delayed.)
68 // Delay in milliseconds from startup. 68 // Delay in milliseconds from startup.
69 const int64 kServiceInitializationStartupDelay = 5000; 69 const int64 kServiceInitializationStartupDelay = 5000;
70 70
71 #if defined(OS_CHROMEOS) 71 #if defined(OS_CHROMEOS)
72 // MachineInfo key names. 72 // MachineInfo key names.
73 const char kMachineInfoSystemHwqual[] = "hardware_class"; 73 const char kMachineInfoSystemHwqual[] = "hardware_class";
74 74
75 // These are the machine serial number keys that we check in order until we 75 // These are the machine serial number keys that we check in order until we
76 // find a non-empty serial number. The VPD spec says the serial number should be 76 // find a non-empty serial number. The VPD spec says the serial number should be
77 // in the "serial_number" key for v2+ VPDs. However, we cannot check this first, 77 // in the "serial_number" key for v2+ VPDs. However, legacy devices used a
78 // since we'd get the "serial_number" value from the SMBIOS (yes, there's a name 78 // different keys to report their serial number, which we fall back to if
79 // clash here!), which is different from the serial number we want and not 79 // "serial_number" is not present.
80 // actually per-device. So, we check the legacy keys first. If we find a
81 // serial number for these, we use it, otherwise we must be on a newer device
82 // that provides the correct data in "serial_number".
83 const char* kMachineInfoSerialNumberKeys[] = { 80 const char* kMachineInfoSerialNumberKeys[] = {
84 "sn", // ZGB 81 "serial_number", // VPD v2+ devices
85 "Product_S/N", // Alex 82 "Product_S/N", // Alex
86 "Product_SN", // Mario 83 "Product_SN", // Mario
87 "serial_number" // VPD v2+ devices 84 "sn", // old ZGB devices (more recent ones use serial_number)
88 }; 85 };
89 #endif 86 #endif
90 87
91 } // namespace 88 } // namespace
92 89
93 BrowserPolicyConnector::BrowserPolicyConnector() 90 BrowserPolicyConnector::BrowserPolicyConnector()
94 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {} 91 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {}
95 92
96 BrowserPolicyConnector::~BrowserPolicyConnector() { 93 BrowserPolicyConnector::~BrowserPolicyConnector() {
97 // Shutdown device cloud policy. 94 // Shutdown device cloud policy.
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return new AsyncPolicyProvider(loader.Pass()); 566 return new AsyncPolicyProvider(loader.Pass());
570 } else { 567 } else {
571 return NULL; 568 return NULL;
572 } 569 }
573 #else 570 #else
574 return NULL; 571 return NULL;
575 #endif 572 #endif
576 } 573 }
577 574
578 } // namespace policy 575 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698