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/system/tray/media_security/multi_profile_media_tray_item.h" | 5 #include "ash/system/tray/media_security/multi_profile_media_tray_item.h" |
6 | 6 |
7 #include "ash/ash_view_ids.h" | 7 #include "ash/ash_view_ids.h" |
8 #include "ash/media_delegate.h" | 8 #include "ash/media_delegate.h" |
9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); | 34 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); |
35 set_id(VIEW_ID_MEDIA_TRAY_VIEW); | 35 set_id(VIEW_ID_MEDIA_TRAY_VIEW); |
36 } | 36 } |
37 | 37 |
38 virtual ~MultiProfileMediaTrayView() { | 38 virtual ~MultiProfileMediaTrayView() { |
39 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( | 39 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( |
40 this); | 40 this); |
41 } | 41 } |
42 | 42 |
43 // MediaCaptureObserver: | 43 // MediaCaptureObserver: |
44 virtual void OnMediaCaptureChanged() OVERRIDE { | 44 virtual void OnMediaCaptureChanged() override { |
45 MediaDelegate* media_delegate = Shell::GetInstance()->media_delegate(); | 45 MediaDelegate* media_delegate = Shell::GetInstance()->media_delegate(); |
46 SessionStateDelegate* session_state_delegate = | 46 SessionStateDelegate* session_state_delegate = |
47 Shell::GetInstance()->session_state_delegate(); | 47 Shell::GetInstance()->session_state_delegate(); |
48 // The user at 0 is the current desktop user. | 48 // The user at 0 is the current desktop user. |
49 for (MultiProfileIndex index = 1; | 49 for (MultiProfileIndex index = 1; |
50 index < session_state_delegate->NumberOfLoggedInUsers(); | 50 index < session_state_delegate->NumberOfLoggedInUsers(); |
51 ++index) { | 51 ++index) { |
52 content::BrowserContext* context = | 52 content::BrowserContext* context = |
53 session_state_delegate->GetBrowserContextByIndex(index); | 53 session_state_delegate->GetBrowserContextByIndex(index); |
54 if (media_delegate->GetMediaCaptureState(context) != MEDIA_CAPTURE_NONE) { | 54 if (media_delegate->GetMediaCaptureState(context) != MEDIA_CAPTURE_NONE) { |
(...skipping 21 matching lines...) Expand all Loading... |
76 user::LoginStatus status) { | 76 user::LoginStatus status) { |
77 tray_view_ = new tray::MultiProfileMediaTrayView(this); | 77 tray_view_ = new tray::MultiProfileMediaTrayView(this); |
78 return tray_view_; | 78 return tray_view_; |
79 } | 79 } |
80 | 80 |
81 void MultiProfileMediaTrayItem::DestroyTrayView() { | 81 void MultiProfileMediaTrayItem::DestroyTrayView() { |
82 tray_view_ = NULL; | 82 tray_view_ = NULL; |
83 } | 83 } |
84 | 84 |
85 } // namespace ash | 85 } // namespace ash |
OLD | NEW |