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

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

Issue 2581353002: Use the Windows MDM API to check if the machine is being managed. (Closed)
Patch Set: rebased 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
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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 // Don't show the bubble if we have a brand code that is NOT organic, unless 403 // Don't show the bubble if we have a brand code that is NOT organic, unless
404 // an outdated build is being simulated by command line switches. 404 // an outdated build is being simulated by command line switches.
405 static bool simulate_outdated = SimulatingOutdated(); 405 static bool simulate_outdated = SimulatingOutdated();
406 if (!simulate_outdated) { 406 if (!simulate_outdated) {
407 std::string brand; 407 std::string brand;
408 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) 408 if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand))
409 return false; 409 return false;
410 410
411 #if defined(OS_WIN) 411 #if defined(OS_WIN)
412 // Don't show the update bubbles to enterprise users (i.e., on a domain). 412 // Don't show the update bubbles to enterprise users.
413 if (base::win::IsEnrolledToDomain()) 413 if (base::win::IsEnterpriseManaged())
414 return false; 414 return false;
415 #endif 415 #endif
416 } 416 }
417 417
418 base::Time network_time; 418 base::Time network_time;
419 base::TimeDelta uncertainty; 419 base::TimeDelta uncertainty;
420 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time, 420 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time,
421 &uncertainty) != 421 &uncertainty) !=
422 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) { 422 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) {
423 // When network time has not been initialized yet, simply rely on the 423 // When network time has not been initialized yet, simply rely on the
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 522
523 // static 523 // static
524 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 524 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
525 return base::Singleton<UpgradeDetectorImpl>::get(); 525 return base::Singleton<UpgradeDetectorImpl>::get();
526 } 526 }
527 527
528 // static 528 // static
529 UpgradeDetector* UpgradeDetector::GetInstance() { 529 UpgradeDetector* UpgradeDetector::GetInstance() {
530 return UpgradeDetectorImpl::GetInstance(); 530 return UpgradeDetectorImpl::GetInstance();
531 } 531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698