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/cpu.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
18 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "base/version.h" | 23 #include "base/version.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/google/google_brand.h" |
25 #include "chrome/browser/google/google_util.h" | 26 #include "chrome/browser/google/google_util.h" |
26 #include "chrome/browser/network_time/network_time_tracker.h" | 27 #include "chrome/browser/network_time/network_time_tracker.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/chrome_version_info.h" | 29 #include "chrome/common/chrome_version_info.h" |
29 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
31 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
32 | 33 |
33 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
34 #include "base/win/win_util.h" | 35 #include "base/win/win_util.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 base::Bind(&UpgradeDetectorImpl::DetectUpgradeTask, | 354 base::Bind(&UpgradeDetectorImpl::DetectUpgradeTask, |
354 weak_factory_.GetWeakPtr())); | 355 weak_factory_.GetWeakPtr())); |
355 } | 356 } |
356 | 357 |
357 bool UpgradeDetectorImpl::DetectOutdatedInstall() { | 358 bool UpgradeDetectorImpl::DetectOutdatedInstall() { |
358 // Don't show the bubble if we have a brand code that is NOT organic, unless | 359 // Don't show the bubble if we have a brand code that is NOT organic, unless |
359 // an outdated build is being simulated by command line switches. | 360 // an outdated build is being simulated by command line switches. |
360 static bool simulate_outdated = SimulatingOutdated(); | 361 static bool simulate_outdated = SimulatingOutdated(); |
361 if (!simulate_outdated) { | 362 if (!simulate_outdated) { |
362 std::string brand; | 363 std::string brand; |
363 if (google_util::GetBrand(&brand) && !google_util::IsOrganic(brand)) | 364 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) |
364 return false; | 365 return false; |
365 | 366 |
366 #if defined(OS_WIN) | 367 #if defined(OS_WIN) |
367 // Don't show the update bubbles to entreprise users (i.e., on a domain). | 368 // Don't show the update bubbles to entreprise users (i.e., on a domain). |
368 if (base::win::IsEnrolledToDomain()) | 369 if (base::win::IsEnrolledToDomain()) |
369 return false; | 370 return false; |
370 | 371 |
371 // On Windows, we don't want to warn about outdated installs when the | 372 // On Windows, we don't want to warn about outdated installs when the |
372 // machine doesn't support SSE2, it's been deprecated starting with M35. | 373 // machine doesn't support SSE2, it's been deprecated starting with M35. |
373 if (!base::CPU().has_sse2()) | 374 if (!base::CPU().has_sse2()) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 479 |
479 // static | 480 // static |
480 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 481 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
481 return Singleton<UpgradeDetectorImpl>::get(); | 482 return Singleton<UpgradeDetectorImpl>::get(); |
482 } | 483 } |
483 | 484 |
484 // static | 485 // static |
485 UpgradeDetector* UpgradeDetector::GetInstance() { | 486 UpgradeDetector* UpgradeDetector::GetInstance() { |
486 return UpgradeDetectorImpl::GetInstance(); | 487 return UpgradeDetectorImpl::GetInstance(); |
487 } | 488 } |
OLD | NEW |