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" |
11 #include "ash/common/system/tray/system_tray_notifier.h" | 11 #include "ash/common/system/tray/system_tray_notifier.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "grit/ash_resources.h" | 13 #include "grit/ash_resources.h" |
14 #include "grit/ash_strings.h" | 14 #include "grit/ash_strings.h" |
15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
17 #include "ui/message_center/message_center.h" | 17 #include "ui/message_center/message_center.h" |
18 #include "ui/message_center/notification.h" | 18 #include "ui/message_center/notification.h" |
19 | 19 |
20 using message_center::Notification; | 20 using message_center::Notification; |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 namespace { | 23 namespace { |
24 | 24 |
25 const char kScreenCaptureNotificationId[] = "chrome://screen/capture"; | 25 const char kScreenCaptureNotificationId[] = "chrome://screen/capture"; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray) | 29 ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray) |
30 : ScreenTrayItem(system_tray) { | 30 : ScreenTrayItem(system_tray, UMA_SCREEN_CAPTURE) { |
31 WmShell::Get()->AddShellObserver(this); | 31 WmShell::Get()->AddShellObserver(this); |
32 WmShell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); | 32 WmShell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); |
33 } | 33 } |
34 | 34 |
35 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { | 35 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { |
36 WmShell::Get()->RemoveShellObserver(this); | 36 WmShell::Get()->RemoveShellObserver(this); |
37 WmShell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); | 37 WmShell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); |
38 } | 38 } |
39 | 39 |
40 views::View* ScreenCaptureTrayItem::CreateTrayView(LoginStatus status) { | 40 views::View* ScreenCaptureTrayItem::CreateTrayView(LoginStatus status) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // screen capture is stopped externally. | 104 // screen capture is stopped externally. |
105 set_is_started(false); | 105 set_is_started(false); |
106 Update(); | 106 Update(); |
107 } | 107 } |
108 | 108 |
109 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { | 109 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { |
110 is_casting_ = started; | 110 is_casting_ = started; |
111 } | 111 } |
112 | 112 |
113 } // namespace ash | 113 } // namespace ash |
OLD | NEW |