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

Unified Diff: ash/common/system/chromeos/screen_security/screen_share_tray_item.cc

Issue 2732813002: chromeos: Move files in //ash/common to //ash, part 1 (Closed)
Patch Set: rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/screen_security/screen_share_tray_item.cc
diff --git a/ash/common/system/chromeos/screen_security/screen_share_tray_item.cc b/ash/common/system/chromeos/screen_security/screen_share_tray_item.cc
deleted file mode 100644
index 61d26325b959cc9ea67bced7ef0999ae4f162a44..0000000000000000000000000000000000000000
--- a/ash/common/system/chromeos/screen_security/screen_share_tray_item.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/system/chromeos/screen_security/screen_share_tray_item.h"
-
-#include <utility>
-
-#include "ash/common/system/system_notifier.h"
-#include "ash/common/system/tray/system_tray_notifier.h"
-#include "ash/common/wm_shell.h"
-#include "ash/resources/grit/ash_resources.h"
-#include "ash/strings/grit/ash_strings.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/message_center/message_center.h"
-#include "ui/message_center/notification.h"
-
-using message_center::Notification;
-
-namespace ash {
-namespace {
-
-const char kScreenShareNotificationId[] = "chrome://screen/share";
-}
-
-ScreenShareTrayItem::ScreenShareTrayItem(SystemTray* system_tray)
- : ScreenTrayItem(system_tray, UMA_SCREEN_SHARE) {
- WmShell::Get()->system_tray_notifier()->AddScreenShareObserver(this);
-}
-
-ScreenShareTrayItem::~ScreenShareTrayItem() {
- WmShell::Get()->system_tray_notifier()->RemoveScreenShareObserver(this);
-}
-
-views::View* ScreenShareTrayItem::CreateDefaultView(LoginStatus status) {
- set_default_view(new tray::ScreenStatusView(
- this,
- l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED),
- l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP)));
- return default_view();
-}
-
-void ScreenShareTrayItem::CreateOrUpdateNotification() {
- base::string16 help_label_text;
- if (!helper_name_.empty()) {
- help_label_text = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED_NAME, helper_name_);
- } else {
- help_label_text = l10n_util::GetStringUTF16(
- IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED);
- }
-
- message_center::RichNotificationData data;
- data.buttons.push_back(message_center::ButtonInfo(
- l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP)));
- ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance();
- std::unique_ptr<Notification> notification(new Notification(
- message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId,
- help_label_text, base::string16() /* body is blank */,
- resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK),
- base::string16() /* display_source */, GURL(),
- message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
- system_notifier::kNotifierScreenShare),
- data, new tray::ScreenNotificationDelegate(this)));
- notification->SetSystemPriority();
- message_center::MessageCenter::Get()->AddNotification(
- std::move(notification));
-}
-
-std::string ScreenShareTrayItem::GetNotificationId() {
- return kScreenShareNotificationId;
-}
-
-void ScreenShareTrayItem::RecordStoppedFromDefaultViewMetric() {
- // Intentionally not recording a metric.
-}
-
-void ScreenShareTrayItem::RecordStoppedFromNotificationViewMetric() {
- // Intentionally not recording a metric.
-}
-
-void ScreenShareTrayItem::OnScreenShareStart(
- const base::Closure& stop_callback,
- const base::string16& helper_name) {
- helper_name_ = helper_name;
- Start(stop_callback);
-}
-
-void ScreenShareTrayItem::OnScreenShareStop() {
- // We do not need to run the stop callback
- // when screening is stopped externally.
- set_is_started(false);
- Update();
-}
-
-} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698