[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / mac / obsolete_system.cc
blob844d75359c2be88acaabd9deee8b7f46795fbd77
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/mac/obsolete_system.h"
7 #include <sys/sysctl.h>
8 #include <sys/types.h>
10 #include "grit/chromium_strings.h"
11 #include "ui/base/l10n/l10n_util.h"
13 #if !defined(ARCH_CPU_64_BITS)
15 // static
16 bool ObsoleteSystemMac::Has32BitOnlyCPU() {
17 int value;
18 size_t valueSize = sizeof(value);
19 if (sysctlbyname("hw.cpu64bit_capable", &value, &valueSize, NULL, 0) != 0) {
20 return true;
22 return value == 0;
25 // static
26 base::string16 ObsoleteSystemMac::LocalizedObsoleteSystemString() {
27 return l10n_util::GetStringUTF16(
28 Is32BitEndOfTheLine() ? IDS_MAC_32_BIT_OBSOLETE_NOW :
29 IDS_MAC_32_BIT_OBSOLETE_SOON);
32 #endif