| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/screen_security/screen_capture_tray_item.h" | 5 #include "ash/common/system/chromeos/screen_security/screen_capture_tray_item.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/metrics/user_metrics_action.h" | 9 #include "ash/common/metrics/user_metrics_action.h" |
| 10 #include "ash/common/system/system_notifier.h" | 10 #include "ash/common/system/system_notifier.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace ash { | 23 namespace ash { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kScreenCaptureNotificationId[] = "chrome://screen/capture"; | 26 const char kScreenCaptureNotificationId[] = "chrome://screen/capture"; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray) | 30 ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray) |
| 31 : ScreenTrayItem(system_tray, UMA_SCREEN_CAPTURE) { | 31 : ScreenTrayItem(system_tray, UMA_SCREEN_CAPTURE) { |
| 32 Shell::GetInstance()->AddShellObserver(this); | 32 Shell::GetInstance()->AddShellObserver(this); |
| 33 WmShell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); | 33 Shell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); |
| 34 } | 34 } |
| 35 | 35 |
| 36 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { | 36 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { |
| 37 Shell::GetInstance()->RemoveShellObserver(this); | 37 Shell::GetInstance()->RemoveShellObserver(this); |
| 38 WmShell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); | 38 Shell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) { | 41 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) { |
| 42 set_default_view(new tray::ScreenStatusView( | 42 set_default_view(new tray::ScreenStatusView( |
| 43 this, screen_capture_status_, | 43 this, screen_capture_status_, |
| 44 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); | 44 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); |
| 45 return default_view(); | 45 return default_view(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { | 48 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // screen capture is stopped externally. | 100 // screen capture is stopped externally. |
| 101 set_is_started(false); | 101 set_is_started(false); |
| 102 Update(); | 102 Update(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { | 105 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { |
| 106 is_casting_ = started; | 106 is_casting_ = started; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace ash | 109 } // namespace ash |
| OLD | NEW |