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

Side by Side Diff: chrome/browser/chromeos/policy/device_status_collector.cc

Issue 885853002: Disable network state reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/chromeos/policy/device_status_collector.h" 5 #include "chrome/browser/chromeos/policy/device_status_collector.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <limits> 8 #include <limits>
9 #include <sys/statvfs.h> 9 #include <sys/statvfs.h>
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 now); 374 now);
375 } else { 375 } else {
376 AddActivePeriod(last_idle_check_, now); 376 AddActivePeriod(last_idle_check_, now);
377 } 377 }
378 378
379 PruneStoredActivityPeriods(now); 379 PruneStoredActivityPeriods(now);
380 } 380 }
381 last_idle_check_ = now; 381 last_idle_check_ = now;
382 } 382 }
383 383
384 bool DeviceStatusCollector::IsAutoLaunchedKioskSession() {
385 // TODO(atwilson): Determine if the currently active session is an
386 // autolaunched kiosk session (http://crbug.com/452968).
387 return false;
388 }
389
384 void DeviceStatusCollector::SampleHardwareStatus() { 390 void DeviceStatusCollector::SampleHardwareStatus() {
385 // If hardware reporting has been disabled, do nothing here. 391 // If hardware reporting has been disabled, do nothing here.
386 if (!report_hardware_status_) 392 if (!report_hardware_status_)
387 return; 393 return;
388 394
389 // Create list of mounted disk volumes to query status. 395 // Create list of mounted disk volumes to query status.
390 std::vector<std::string> mount_points; 396 std::vector<std::string> mount_points;
391 for (const auto& mount_info : 397 for (const auto& mount_info :
392 chromeos::disks::DiskMountManager::GetInstance()->mount_points()) { 398 chromeos::disks::DiskMountManager::GetInstance()->mount_points()) {
393 // Extract a list of mount points to populate. 399 // Extract a list of mount points to populate.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 if (!(*device)->mac_address().empty()) 590 if (!(*device)->mac_address().empty())
585 interface->set_mac_address((*device)->mac_address()); 591 interface->set_mac_address((*device)->mac_address());
586 if (!(*device)->meid().empty()) 592 if (!(*device)->meid().empty())
587 interface->set_meid((*device)->meid()); 593 interface->set_meid((*device)->meid());
588 if (!(*device)->imei().empty()) 594 if (!(*device)->imei().empty())
589 interface->set_imei((*device)->imei()); 595 interface->set_imei((*device)->imei());
590 if (!(*device)->path().empty()) 596 if (!(*device)->path().empty())
591 interface->set_device_path((*device)->path()); 597 interface->set_device_path((*device)->path());
592 } 598 }
593 599
600 // Don't write any network state if we aren't in a kiosk session.
601 if (!IsAutoLaunchedKioskSession())
602 return;
603
594 // Walk the various networks and store their state in the status report. 604 // Walk the various networks and store their state in the status report.
595 chromeos::NetworkStateHandler::NetworkStateList state_list; 605 chromeos::NetworkStateHandler::NetworkStateList state_list;
596 network_state_handler->GetNetworkListByType( 606 network_state_handler->GetNetworkListByType(
597 chromeos::NetworkTypePattern::Default(), 607 chromeos::NetworkTypePattern::Default(),
598 true, // configured_only 608 true, // configured_only
599 false, // visible_only, 609 false, // visible_only,
600 0, // no limit to number of results 610 0, // no limit to number of results
601 &state_list); 611 &state_list);
602 612
603 for (const chromeos::NetworkState* state: state_list) { 613 for (const chromeos::NetworkState* state: state_list) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 ScheduleGeolocationUpdateRequest(); 786 ScheduleGeolocationUpdateRequest();
777 } 787 }
778 788
779 void DeviceStatusCollector::ReceiveVolumeInfo( 789 void DeviceStatusCollector::ReceiveVolumeInfo(
780 const std::vector<em::VolumeInfo>& info) { 790 const std::vector<em::VolumeInfo>& info) {
781 if (report_hardware_status_) 791 if (report_hardware_status_)
782 volume_info_ = info; 792 volume_info_ = info;
783 } 793 }
784 794
785 } // namespace policy 795 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698