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/upgrade_detector_impl.h" | 5 #include "chrome/browser/upgrade_detector_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/cpu.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
16 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
17 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
18 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
21 #include "base/time/time.h" | 22 #include "base/time/time.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 static bool simulate_outdated = SimulatingOutdated(); | 397 static bool simulate_outdated = SimulatingOutdated(); |
397 if (!simulate_outdated) { | 398 if (!simulate_outdated) { |
398 std::string brand; | 399 std::string brand; |
399 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) | 400 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) |
400 return false; | 401 return false; |
401 | 402 |
402 #if defined(OS_WIN) | 403 #if defined(OS_WIN) |
403 // Don't show the update bubbles to enterprise users (i.e., on a domain). | 404 // Don't show the update bubbles to enterprise users (i.e., on a domain). |
404 if (base::win::IsEnrolledToDomain()) | 405 if (base::win::IsEnrolledToDomain()) |
405 return false; | 406 return false; |
| 407 |
| 408 // On Windows, we don't want to warn about outdated installs when the |
| 409 // machine doesn't support SSE2, it's been deprecated starting with M35. |
| 410 if (!base::CPU().has_sse2()) |
| 411 return false; |
406 #endif | 412 #endif |
407 } | 413 } |
408 | 414 |
409 base::Time network_time; | 415 base::Time network_time; |
410 base::TimeDelta uncertainty; | 416 base::TimeDelta uncertainty; |
411 if (!g_browser_process->network_time_tracker()->GetNetworkTime( | 417 if (!g_browser_process->network_time_tracker()->GetNetworkTime( |
412 base::TimeTicks::Now(), &network_time, &uncertainty)) { | 418 base::TimeTicks::Now(), &network_time, &uncertainty)) { |
413 // When network time has not been initialized yet, simply rely on the | 419 // When network time has not been initialized yet, simply rely on the |
414 // machine's current time. | 420 // machine's current time. |
415 network_time = base::Time::Now(); | 421 network_time = base::Time::Now(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 518 |
513 // static | 519 // static |
514 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 520 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
515 return Singleton<UpgradeDetectorImpl>::get(); | 521 return Singleton<UpgradeDetectorImpl>::get(); |
516 } | 522 } |
517 | 523 |
518 // static | 524 // static |
519 UpgradeDetector* UpgradeDetector::GetInstance() { | 525 UpgradeDetector* UpgradeDetector::GetInstance() { |
520 return UpgradeDetectorImpl::GetInstance(); | 526 return UpgradeDetectorImpl::GetInstance(); |
521 } | 527 } |
OLD | NEW |