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

Side by Side Diff: chrome/browser/chromeos/camera_presence_notifier.cc

Issue 2416763002: Replace FOR_EACH_OBSERVER in c/b/chromeos with range-based for (Closed)
Patch Set: Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/camera_presence_notifier.h" 5 #include "chrome/browser/chromeos/camera_presence_notifier.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/chromeos/camera_detector.h" 10 #include "chrome/browser/chromeos/camera_detector.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 CameraDetector::StartPresenceCheck( 57 CameraDetector::StartPresenceCheck(
58 base::Bind(&CameraPresenceNotifier::OnCameraPresenceCheckDone, 58 base::Bind(&CameraPresenceNotifier::OnCameraPresenceCheckDone,
59 weak_factory_.GetWeakPtr())); 59 weak_factory_.GetWeakPtr()));
60 } 60 }
61 61
62 void CameraPresenceNotifier::OnCameraPresenceCheckDone() { 62 void CameraPresenceNotifier::OnCameraPresenceCheckDone() {
63 bool is_camera_present = 63 bool is_camera_present =
64 CameraDetector::camera_presence() == CameraDetector::kCameraPresent; 64 CameraDetector::camera_presence() == CameraDetector::kCameraPresent;
65 if (is_camera_present != camera_present_on_last_check_) { 65 if (is_camera_present != camera_present_on_last_check_) {
66 camera_present_on_last_check_ = is_camera_present; 66 camera_present_on_last_check_ = is_camera_present;
67 FOR_EACH_OBSERVER(Observer, 67 for (auto& observer : observers_)
68 observers_, 68 observer.OnCameraPresenceCheckDone(camera_present_on_last_check_);
69 OnCameraPresenceCheckDone(camera_present_on_last_check_));
70 } 69 }
71 } 70 }
72 71
73 } // namespace chromeos 72 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_manager.cc ('k') | chrome/browser/chromeos/device/input_service_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698