15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_ 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/basictypes.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/strings/string16.h" 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class ObsoleteSystemMac { 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // true if 32-bit-only systems are already considered obsolete, or if 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // they'll be considered obsolete soon. Used to control whether to show 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // messaging about 32-bit deprecation within the app. 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static bool Is32BitObsoleteNowOrSoon() { 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#if defined(GOOGLE_CHROME_BUILD) 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return true; 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#else 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // true if the system's CPU is 32-bit-only, false if it's 64-bit-capable. 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#if !defined(ARCH_CPU_64_BITS) 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static bool Has32BitOnlyCPU(); 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#else 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static bool Has32BitOnlyCPU() { 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Returns a localized string informing users that their system will either 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // soon be unsupported by future versions of the application, or that they 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // are already using the last version of the application that supports their 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // system. Do not use the returned string unless both 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Is32BitObsoleteNowOrSoon() and Has32BitOnlyCPU() return true. 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#if !defined(ARCH_CPU_64_BITS) 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static base::string16 LocalizedObsoleteSystemString(); 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#else 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static base::string16 LocalizedObsoleteSystemString() { 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return base::string16(); 435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // true if this is the final release that will run on 32-bit-only systems. 475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static bool Is32BitEndOfTheLine() { 485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // TODO(mark): Change to true immediately prior to the final build that 495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // supports 32-bit-only systems. 505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 515d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 535d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private: 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) DISALLOW_IMPLICIT_CONSTRUCTORS(ObsoleteSystemMac); 555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_ 58