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

Side by Side Diff: chrome/browser/upgrade_detector_impl.cc

Issue 2734133002: Make the OutdatedBuildDetector feature static. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // We use FILE as the thread to run the upgrade detection code on all 371 // We use FILE as the thread to run the upgrade detection code on all
372 // platforms. For Linux, this is because we don't want to block the UI thread 372 // platforms. For Linux, this is because we don't want to block the UI thread
373 // while launching a background process and reading its output; on the Mac and 373 // while launching a background process and reading its output; on the Mac and
374 // on Windows checking for an upgrade requires reading a file. 374 // on Windows checking for an upgrade requires reading a file.
375 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 375 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
376 base::Bind(&UpgradeDetectorImpl::DetectUpgradeTask, 376 base::Bind(&UpgradeDetectorImpl::DetectUpgradeTask,
377 weak_factory_.GetWeakPtr())); 377 weak_factory_.GetWeakPtr()));
378 } 378 }
379 379
380 bool UpgradeDetectorImpl::DetectOutdatedInstall() { 380 bool UpgradeDetectorImpl::DetectOutdatedInstall() {
381 constexpr base::Feature kOutdatedBuildDetector = 381 static constexpr base::Feature kOutdatedBuildDetector = {
382 { "OutdatedBuildDetector", base::FEATURE_ENABLED_BY_DEFAULT }; 382 "OutdatedBuildDetector", base::FEATURE_ENABLED_BY_DEFAULT};
383 383
384 if (!base::FeatureList::IsEnabled(kOutdatedBuildDetector)) 384 if (!base::FeatureList::IsEnabled(kOutdatedBuildDetector))
385 return false; 385 return false;
386 386
387 // Don't show the bubble if we have a brand code that is NOT organic, unless 387 // Don't show the bubble if we have a brand code that is NOT organic, unless
388 // an outdated build is being simulated by command line switches. 388 // an outdated build is being simulated by command line switches.
389 static bool simulate_outdated = SimulatingOutdated(); 389 static bool simulate_outdated = SimulatingOutdated();
390 if (!simulate_outdated) { 390 if (!simulate_outdated) {
391 std::string brand; 391 std::string brand;
392 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) 392 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand))
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 // static 507 // static
508 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 508 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
509 return base::Singleton<UpgradeDetectorImpl>::get(); 509 return base::Singleton<UpgradeDetectorImpl>::get();
510 } 510 }
511 511
512 // static 512 // static
513 UpgradeDetector* UpgradeDetector::GetInstance() { 513 UpgradeDetector* UpgradeDetector::GetInstance() {
514 return UpgradeDetectorImpl::GetInstance(); 514 return UpgradeDetectorImpl::GetInstance();
515 } 515 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698