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

Side by Side Diff: ash/system/chromeos/screen_security/screen_share_tray_item.cc

Issue 2098023002: mash: Migrate remaining tray observers and notify functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 5 months 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/system/chromeos/screen_security/screen_share_tray_item.h" 5 #include "ash/system/chromeos/screen_security/screen_share_tray_item.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/system/system_notifier.h" 9 #include "ash/common/system/system_notifier.h"
10 #include "ash/shell.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/wm_shell.h"
11 #include "grit/ash_resources.h" 12 #include "grit/ash_resources.h"
12 #include "grit/ash_strings.h" 13 #include "grit/ash_strings.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/message_center/message_center.h" 16 #include "ui/message_center/message_center.h"
16 #include "ui/message_center/notification.h" 17 #include "ui/message_center/notification.h"
17 18
18 using message_center::Notification; 19 using message_center::Notification;
19 20
20 namespace ash { 21 namespace ash {
21 namespace { 22 namespace {
22 23
23 const char kScreenShareNotificationId[] = "chrome://screen/share"; 24 const char kScreenShareNotificationId[] = "chrome://screen/share";
24 25
25 } 26 }
26 27
27 ScreenShareTrayItem::ScreenShareTrayItem(SystemTray* system_tray) 28 ScreenShareTrayItem::ScreenShareTrayItem(SystemTray* system_tray)
28 : ScreenTrayItem(system_tray) { 29 : ScreenTrayItem(system_tray) {
29 Shell::GetInstance()->system_tray_notifier()-> 30 WmShell::Get()->system_tray_notifier()->AddScreenShareObserver(this);
30 AddScreenShareObserver(this);
31 } 31 }
32 32
33 ScreenShareTrayItem::~ScreenShareTrayItem() { 33 ScreenShareTrayItem::~ScreenShareTrayItem() {
34 Shell::GetInstance()->system_tray_notifier()-> 34 WmShell::Get()->system_tray_notifier()->RemoveScreenShareObserver(this);
35 RemoveScreenShareObserver(this);
36 } 35 }
37 36
38 views::View* ScreenShareTrayItem::CreateTrayView(LoginStatus status) { 37 views::View* ScreenShareTrayItem::CreateTrayView(LoginStatus status) {
39 set_tray_view( 38 set_tray_view(
40 new tray::ScreenTrayView(this, IDR_AURA_UBER_TRAY_SCREENSHARE)); 39 new tray::ScreenTrayView(this, IDR_AURA_UBER_TRAY_SCREENSHARE));
41 return tray_view(); 40 return tray_view();
42 } 41 }
43 42
44 views::View* ScreenShareTrayItem::CreateDefaultView(LoginStatus status) { 43 views::View* ScreenShareTrayItem::CreateDefaultView(LoginStatus status) {
45 set_default_view(new tray::ScreenStatusView( 44 set_default_view(new tray::ScreenStatusView(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 91 }
93 92
94 void ScreenShareTrayItem::OnScreenShareStop() { 93 void ScreenShareTrayItem::OnScreenShareStop() {
95 // We do not need to run the stop callback 94 // We do not need to run the stop callback
96 // when screening is stopped externally. 95 // when screening is stopped externally.
97 set_is_started(false); 96 set_is_started(false);
98 Update(); 97 Update();
99 } 98 }
100 99
101 } // namespace ash 100 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698