| 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_share_tray_item.h" | 5 #include "ash/common/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/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| 11 #include "ash/common/wm_shell.h" | |
| 12 #include "ash/resources/grit/ash_resources.h" | 11 #include "ash/resources/grit/ash_resources.h" |
| 12 #include "ash/shell.h" |
| 13 #include "ash/strings/grit/ash_strings.h" | 13 #include "ash/strings/grit/ash_strings.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/message_center/message_center.h" | 16 #include "ui/message_center/message_center.h" |
| 17 #include "ui/message_center/notification.h" | 17 #include "ui/message_center/notification.h" |
| 18 | 18 |
| 19 using message_center::Notification; | 19 using message_center::Notification; |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const char kScreenShareNotificationId[] = "chrome://screen/share"; | 24 const char kScreenShareNotificationId[] = "chrome://screen/share"; |
| 25 } | 25 } |
| 26 | 26 |
| 27 ScreenShareTrayItem::ScreenShareTrayItem(SystemTray* system_tray) | 27 ScreenShareTrayItem::ScreenShareTrayItem(SystemTray* system_tray) |
| 28 : ScreenTrayItem(system_tray, UMA_SCREEN_SHARE) { | 28 : ScreenTrayItem(system_tray, UMA_SCREEN_SHARE) { |
| 29 WmShell::Get()->system_tray_notifier()->AddScreenShareObserver(this); | 29 Shell::Get()->system_tray_notifier()->AddScreenShareObserver(this); |
| 30 } | 30 } |
| 31 | 31 |
| 32 ScreenShareTrayItem::~ScreenShareTrayItem() { | 32 ScreenShareTrayItem::~ScreenShareTrayItem() { |
| 33 WmShell::Get()->system_tray_notifier()->RemoveScreenShareObserver(this); | 33 Shell::Get()->system_tray_notifier()->RemoveScreenShareObserver(this); |
| 34 } | 34 } |
| 35 | 35 |
| 36 views::View* ScreenShareTrayItem::CreateDefaultView(LoginStatus status) { | 36 views::View* ScreenShareTrayItem::CreateDefaultView(LoginStatus status) { |
| 37 set_default_view(new tray::ScreenStatusView( | 37 set_default_view(new tray::ScreenStatusView( |
| 38 this, | 38 this, |
| 39 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED), | 39 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED), |
| 40 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP))); | 40 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP))); |
| 41 return default_view(); | 41 return default_view(); |
| 42 } | 42 } |
| 43 | 43 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ScreenShareTrayItem::OnScreenShareStop() { | 90 void ScreenShareTrayItem::OnScreenShareStop() { |
| 91 // We do not need to run the stop callback | 91 // We do not need to run the stop callback |
| 92 // when screening is stopped externally. | 92 // when screening is stopped externally. |
| 93 set_is_started(false); | 93 set_is_started(false); |
| 94 Update(); | 94 Update(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace ash | 97 } // namespace ash |
| OLD | NEW |