OLD | NEW |
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/chrome_browser_main_mac.h" | 5 #include "chrome/browser/chrome_browser_main_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <sys/sysctl.h> | 8 #include <sys/sysctl.h> |
9 | 9 |
10 #include "apps/app_shim/app_shim_host_manager_mac.h" | 10 #include "apps/app_shim/app_shim_host_manager_mac.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // DON'T add new constants here. It's important to keep the constant values, | 53 // DON'T add new constants here. It's important to keep the constant values, |
54 // um, constant. Add new constants at the bottom. | 54 // um, constant. Add new constants at the bottom. |
55 | 55 |
56 // What if the bitsiness of the CPU can't be determined? | 56 // What if the bitsiness of the CPU can't be determined? |
57 SABER_TOOTHED_CAT_DUNNO, | 57 SABER_TOOTHED_CAT_DUNNO, |
58 SNOW_LEOPARD_DUNNO, | 58 SNOW_LEOPARD_DUNNO, |
59 LION_DUNNO, | 59 LION_DUNNO, |
60 MOUNTAIN_LION_DUNNO, | 60 MOUNTAIN_LION_DUNNO, |
61 MAVERICKS_DUNNO, | 61 MAVERICKS_DUNNO, |
62 | 62 |
| 63 // More known cats. |
| 64 YOSEMITE_32, // Unexpected, Yosemite requires a 64-bit CPU. |
| 65 YOSEMITE_64, |
| 66 YOSEMITE_DUNNO, |
| 67 |
63 // Newer than any known cat. | 68 // Newer than any known cat. |
64 FUTURE_CAT_32, // Unexpected, it's unlikely Apple will un-obsolete old CPUs. | 69 FUTURE_CAT_32, // Unexpected, it's unlikely Apple will un-obsolete old CPUs. |
65 FUTURE_CAT_64, | 70 FUTURE_CAT_64, |
66 FUTURE_CAT_DUNNO, | 71 FUTURE_CAT_DUNNO, |
67 | 72 |
68 // As new versions of Mac OS X are released with sillier and sillier names, | 73 // As new versions of Mac OS X are released with sillier and sillier names, |
69 // rename the FUTURE_CAT enum values to match those names, and re-create | 74 // rename the FUTURE_CAT enum values to match those names, and re-create |
70 // FUTURE_CAT_[32|64|DUNNO] here. | 75 // FUTURE_CAT_[32|64|DUNNO] here. |
71 | 76 |
72 CAT_SIXTY_FOUR_MAX | 77 CAT_SIXTY_FOUR_MAX |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 LION_DUNNO; | 111 LION_DUNNO; |
107 } | 112 } |
108 if (base::mac::IsOSMountainLion()) { | 113 if (base::mac::IsOSMountainLion()) { |
109 return cpu64_known ? (cpu64 ? MOUNTAIN_LION_64 : MOUNTAIN_LION_32) : | 114 return cpu64_known ? (cpu64 ? MOUNTAIN_LION_64 : MOUNTAIN_LION_32) : |
110 MOUNTAIN_LION_DUNNO; | 115 MOUNTAIN_LION_DUNNO; |
111 } | 116 } |
112 if (base::mac::IsOSMavericks()) { | 117 if (base::mac::IsOSMavericks()) { |
113 return cpu64_known ? (cpu64 ? MAVERICKS_64 : MAVERICKS_32) : | 118 return cpu64_known ? (cpu64 ? MAVERICKS_64 : MAVERICKS_32) : |
114 MAVERICKS_DUNNO; | 119 MAVERICKS_DUNNO; |
115 } | 120 } |
116 if (base::mac::IsOSLaterThanMavericks_DontCallThis()) { | 121 if (base::mac::IsOSYosemite()) { |
| 122 return cpu64_known ? (cpu64 ? YOSEMITE_64 : YOSEMITE_32) : |
| 123 YOSEMITE_DUNNO; |
| 124 } |
| 125 if (base::mac::IsOSLaterThanYosemite_DontCallThis()) { |
117 return cpu64_known ? (cpu64 ? FUTURE_CAT_64 : FUTURE_CAT_32) : | 126 return cpu64_known ? (cpu64 ? FUTURE_CAT_64 : FUTURE_CAT_32) : |
118 FUTURE_CAT_DUNNO; | 127 FUTURE_CAT_DUNNO; |
119 } | 128 } |
120 | 129 |
121 // If it's not any of the expected OS versions or later than them, it must | 130 // If it's not any of the expected OS versions or later than them, it must |
122 // be prehistoric. | 131 // be prehistoric. |
123 return cpu64_known ? (cpu64 ? SABER_TOOTHED_CAT_64 : SABER_TOOTHED_CAT_32) : | 132 return cpu64_known ? (cpu64 ? SABER_TOOTHED_CAT_64 : SABER_TOOTHED_CAT_32) : |
124 SABER_TOOTHED_CAT_DUNNO; | 133 SABER_TOOTHED_CAT_DUNNO; |
125 } | 134 } |
126 | 135 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 void ChromeBrowserMainPartsMac::PostProfileInit() { | 265 void ChromeBrowserMainPartsMac::PostProfileInit() { |
257 ChromeBrowserMainPartsPosix::PostProfileInit(); | 266 ChromeBrowserMainPartsPosix::PostProfileInit(); |
258 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 267 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
259 breakpad::IsCrashReporterEnabled()); | 268 breakpad::IsCrashReporterEnabled()); |
260 } | 269 } |
261 | 270 |
262 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 271 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
263 AppController* appController = [NSApp delegate]; | 272 AppController* appController = [NSApp delegate]; |
264 [appController didEndMainMessageLoop]; | 273 [appController didEndMainMessageLoop]; |
265 } | 274 } |
OLD | NEW |