| OLD | NEW |
| 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 "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite
m.h" | 5 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite
m.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_view_ids.h" | 7 #include "ash/common/ash_view_ids.h" |
| 8 #include "ash/common/media_controller.h" | 8 #include "ash/common/media_controller.h" |
| 9 #include "ash/common/session/session_controller.h" | 9 #include "ash/common/session/session_controller.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 set_id(VIEW_ID_MEDIA_TRAY_VIEW); | 33 set_id(VIEW_ID_MEDIA_TRAY_VIEW); |
| 34 } | 34 } |
| 35 | 35 |
| 36 ~MultiProfileMediaTrayView() override { | 36 ~MultiProfileMediaTrayView() override { |
| 37 Shell::Get()->media_controller()->RemoveObserver(this); | 37 Shell::Get()->media_controller()->RemoveObserver(this); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // MediaCaptureObserver: | 40 // MediaCaptureObserver: |
| 41 void OnMediaCaptureChanged( | 41 void OnMediaCaptureChanged( |
| 42 const std::vector<mojom::MediaCaptureState>& capture_states) override { | 42 const std::vector<mojom::MediaCaptureState>& capture_states) override { |
| 43 SessionController* controller = WmShell::Get()->session_controller(); | 43 SessionController* controller = Shell::Get()->session_controller(); |
| 44 // The user at 0 is the current desktop user. | 44 // The user at 0 is the current desktop user. |
| 45 for (UserIndex index = 1; index < controller->NumberOfLoggedInUsers(); | 45 for (UserIndex index = 1; index < controller->NumberOfLoggedInUsers(); |
| 46 ++index) { | 46 ++index) { |
| 47 if (capture_states[index] != mojom::MediaCaptureState::NONE) { | 47 if (capture_states[index] != mojom::MediaCaptureState::NONE) { |
| 48 SetVisible(true); | 48 SetVisible(true); |
| 49 return; | 49 return; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 SetVisible(false); | 52 SetVisible(false); |
| 53 } | 53 } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(MultiProfileMediaTrayView); | 56 DISALLOW_COPY_AND_ASSIGN(MultiProfileMediaTrayView); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace tray | 59 } // namespace tray |
| 60 | 60 |
| 61 MultiProfileMediaTrayItem::MultiProfileMediaTrayItem(SystemTray* system_tray) | 61 MultiProfileMediaTrayItem::MultiProfileMediaTrayItem(SystemTray* system_tray) |
| 62 : SystemTrayItem(system_tray, UMA_MULTI_PROFILE_MEDIA) {} | 62 : SystemTrayItem(system_tray, UMA_MULTI_PROFILE_MEDIA) {} |
| 63 | 63 |
| 64 MultiProfileMediaTrayItem::~MultiProfileMediaTrayItem() {} | 64 MultiProfileMediaTrayItem::~MultiProfileMediaTrayItem() {} |
| 65 | 65 |
| 66 views::View* MultiProfileMediaTrayItem::CreateTrayView(LoginStatus status) { | 66 views::View* MultiProfileMediaTrayItem::CreateTrayView(LoginStatus status) { |
| 67 return new tray::MultiProfileMediaTrayView(this); | 67 return new tray::MultiProfileMediaTrayView(this); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace ash | 70 } // namespace ash |
| OLD | NEW |