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

Unified Diff: chrome/browser/mac/system_bitness.cc

Issue 125443002: In-app messaging to communicate the imminent 32-bit deprecation to 32-bit-only users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/mac/system_bitness.cc
diff --git a/chrome/browser/mac/system_bitness.cc b/chrome/browser/mac/system_bitness.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0f7582be9ddd304cf9bf4b08f5816c0e4a250efa
--- /dev/null
+++ b/chrome/browser/mac/system_bitness.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/mac/system_bitness.h"
+
+#include <sys/sysctl.h>
+#include <sys/types.h>
+
+#include "grit/chromium_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace chrome {
+
+#if !defined(ARCH_CPU_64_BITS)
+
+bool Has32BitOnlyCPU() {
+ int value;
+ size_t valueSize = sizeof(value);
+ if (sysctlbyname("hw.cpu64bit_capable", &value, &valueSize, NULL, 0) != 0) {
+ return true;
+ }
+ return value == 0;
+}
+
+base::string16 LocalizedObsoleteSystemString() {
+ return l10n_util::GetStringFUTF16(
+ Is32BitEndOfTheLine() ? IDS_MAC_32_BIT_OBSOLETE_NOW :
+ IDS_MAC_32_BIT_OBSOLETE_SOON,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
+}
+
+#endif
+
+bool Is32BitEndOfTheLine() {
+ // TODO(mark): Change to true immediately prior to the final build that
+ // supports 32-bit-only systems.
+ return false;
+}
+
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698