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/user/user_card_view.h" | 5 #include "ash/system/user/user_card_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 .ToImageSkia()); | 67 .ToImageSkia()); |
68 AddChildView(icon); | 68 AddChildView(icon); |
69 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 69 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
70 label_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 70 label_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
71 ui::ResourceBundle::SmallFont)); | 71 ui::ResourceBundle::SmallFont)); |
72 OnMediaCaptureChanged(); | 72 OnMediaCaptureChanged(); |
73 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); | 73 Shell::GetInstance()->system_tray_notifier()->AddMediaCaptureObserver(this); |
74 set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); | 74 set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); |
75 } | 75 } |
76 | 76 |
77 virtual ~MediaIndicator() { | 77 ~MediaIndicator() override { |
78 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( | 78 Shell::GetInstance()->system_tray_notifier()->RemoveMediaCaptureObserver( |
79 this); | 79 this); |
80 } | 80 } |
81 | 81 |
82 // MediaCaptureObserver: | 82 // MediaCaptureObserver: |
83 virtual void OnMediaCaptureChanged() override { | 83 void OnMediaCaptureChanged() override { |
84 Shell* shell = Shell::GetInstance(); | 84 Shell* shell = Shell::GetInstance(); |
85 content::BrowserContext* context = | 85 content::BrowserContext* context = |
86 shell->session_state_delegate()->GetBrowserContextByIndex(index_); | 86 shell->session_state_delegate()->GetBrowserContextByIndex(index_); |
87 MediaCaptureState state = | 87 MediaCaptureState state = |
88 Shell::GetInstance()->media_delegate()->GetMediaCaptureState(context); | 88 Shell::GetInstance()->media_delegate()->GetMediaCaptureState(context); |
89 int res_id = 0; | 89 int res_id = 0; |
90 switch (state) { | 90 switch (state) { |
91 case MEDIA_CAPTURE_AUDIO_VIDEO: | 91 case MEDIA_CAPTURE_AUDIO_VIDEO: |
92 res_id = IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO_VIDEO; | 92 res_id = IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO_VIDEO; |
93 break; | 93 break; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 content::BrowserContext* context = | 455 content::BrowserContext* context = |
456 delegate->GetBrowserContextByIndex(multiprofile_index); | 456 delegate->GetBrowserContextByIndex(multiprofile_index); |
457 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), | 457 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), |
458 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); | 458 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); |
459 } | 459 } |
460 return icon; | 460 return icon; |
461 } | 461 } |
462 | 462 |
463 } // namespace tray | 463 } // namespace tray |
464 } // namespace ash | 464 } // namespace ash |
OLD | NEW |