Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc

Issue 2465403002: Some more fixes to cros system tray icons (esp. screen tray items) (Closed)
Patch Set: commentary Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 : ScreenTrayItem(system_tray, UMA_SCREEN_CAPTURE) { 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) {
41 set_tray_view(new tray::ScreenTrayView(this));
42 return tray_view();
43 }
44
45 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) { 40 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) {
46 set_default_view(new tray::ScreenStatusView( 41 set_default_view(new tray::ScreenStatusView(
47 this, screen_capture_status_, 42 this, screen_capture_status_,
48 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); 43 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP)));
49 return default_view(); 44 return default_view();
50 } 45 }
51 46
52 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { 47 void ScreenCaptureTrayItem::CreateOrUpdateNotification() {
53 message_center::RichNotificationData data; 48 message_center::RichNotificationData data;
54 data.buttons.push_back(message_center::ButtonInfo( 49 data.buttons.push_back(message_center::ButtonInfo(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // screen capture is stopped externally. 99 // screen capture is stopped externally.
105 set_is_started(false); 100 set_is_started(false);
106 Update(); 101 Update();
107 } 102 }
108 103
109 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { 104 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) {
110 is_casting_ = started; 105 is_casting_ = started;
111 } 106 }
112 107
113 } // namespace ash 108 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698