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

Unified Diff: ash/system/chromeos/screen_security/screen_tray_item.h

Issue 2109613005: mash: Move system tray cast code into //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forward decl Created 4 years, 6 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/system/chromeos/screen_security/screen_tray_item.h
diff --git a/ash/system/chromeos/screen_security/screen_tray_item.h b/ash/system/chromeos/screen_security/screen_tray_item.h
deleted file mode 100644
index 9452f48044f00e871b7ab402ba0e4602c011f2ca..0000000000000000000000000000000000000000
--- a/ash/system/chromeos/screen_security/screen_tray_item.h
+++ /dev/null
@@ -1,136 +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.
-
-#ifndef ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_
-#define ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_
-
-#include "ash/common/system/tray/system_tray_item.h"
-#include "ash/common/system/tray/tray_item_view.h"
-#include "ash/common/system/tray/tray_notification_view.h"
-#include "ash/common/system/tray/tray_popup_label_button.h"
-#include "ash/system/tray/system_tray.h"
-#include "base/macros.h"
-#include "ui/message_center/notification_delegate.h"
-#include "ui/views/controls/button/button.h"
-#include "ui/views/controls/image_view.h"
-
-namespace views {
-class View;
-}
-
-namespace ash {
-class ScreenTrayItem;
-
-namespace tray {
-
-class ScreenTrayView : public TrayItemView {
- public:
- ScreenTrayView(ScreenTrayItem* screen_tray_item, int icon_id);
- ~ScreenTrayView() override;
-
- void Update();
-
- private:
- ScreenTrayItem* screen_tray_item_;
-
- DISALLOW_COPY_AND_ASSIGN(ScreenTrayView);
-};
-
-class ScreenStatusView : public views::View, public views::ButtonListener {
- public:
- ScreenStatusView(ScreenTrayItem* screen_tray_item,
- int icon_id,
- const base::string16& label_text,
- const base::string16& stop_button_text);
- ~ScreenStatusView() override;
-
- // Overridden from views::View.
- void Layout() override;
-
- // Overridden from views::ButtonListener.
- void ButtonPressed(views::Button* sender, const ui::Event& event) override;
-
- void CreateItems();
- void Update();
-
- private:
- ScreenTrayItem* screen_tray_item_;
- views::ImageView* icon_;
- views::Label* label_;
- TrayPopupLabelButton* stop_button_;
- int icon_id_;
- base::string16 label_text_;
- base::string16 stop_button_text_;
-
- DISALLOW_COPY_AND_ASSIGN(ScreenStatusView);
-};
-
-class ScreenNotificationDelegate : public message_center::NotificationDelegate {
- public:
- explicit ScreenNotificationDelegate(ScreenTrayItem* screen_tray);
-
- // message_center::NotificationDelegate overrides:
- void ButtonClick(int button_index) override;
-
- protected:
- ~ScreenNotificationDelegate() override;
-
- private:
- ScreenTrayItem* screen_tray_;
-
- DISALLOW_COPY_AND_ASSIGN(ScreenNotificationDelegate);
-};
-
-} // namespace tray
-
-// The base tray item for screen capture and screen sharing. The
-// Start method brings up a notification and a tray item, and the user
-// can stop the screen capture/sharing by pressing the stop button.
-class ASH_EXPORT ScreenTrayItem : public SystemTrayItem {
- public:
- explicit ScreenTrayItem(SystemTray* system_tray);
- ~ScreenTrayItem() override;
-
- tray::ScreenTrayView* tray_view() { return tray_view_; }
- void set_tray_view(tray::ScreenTrayView* tray_view) {
- tray_view_ = tray_view;
- }
-
- tray::ScreenStatusView* default_view() { return default_view_; }
- void set_default_view(tray::ScreenStatusView* default_view) {
- default_view_ = default_view;
- }
-
- bool is_started() const { return is_started_; }
- void set_is_started(bool is_started) { is_started_ = is_started; }
-
- void Update();
- void Start(const base::Closure& stop_callback);
- void Stop();
-
- // Creates or updates the notification for the tray item.
- virtual void CreateOrUpdateNotification() = 0;
-
- // Returns the id of the notification for the tray item.
- virtual std::string GetNotificationId() = 0;
-
- // Overridden from SystemTrayItem.
- views::View* CreateTrayView(LoginStatus status) override = 0;
- views::View* CreateDefaultView(LoginStatus status) override = 0;
- void DestroyTrayView() override;
- void DestroyDefaultView() override;
- void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
-
- private:
- tray::ScreenTrayView* tray_view_;
- tray::ScreenStatusView* default_view_;
- bool is_started_;
- base::Closure stop_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem);
-};
-
-} // namespace ash
-
-#endif // ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_
« no previous file with comments | « ash/system/chromeos/screen_security/screen_share_tray_item.cc ('k') | ash/system/chromeos/screen_security/screen_tray_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698