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

Unified Diff: ash/system/chromeos/screen_security/screen_capture_tray_item.cc

Issue 1118613003: Add UI for cast system tray integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove accidental comment Created 5 years, 8 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_capture_tray_item.cc
diff --git a/ash/system/chromeos/screen_security/screen_capture_tray_item.cc b/ash/system/chromeos/screen_security/screen_capture_tray_item.cc
index c4689ded2cac3c6cb62486c8d7eb69d46ab1872f..c8c5bac2ac198db76e376bc3a995060174d20c1c 100644
--- a/ash/system/chromeos/screen_security/screen_capture_tray_item.cc
+++ b/ash/system/chromeos/screen_security/screen_capture_tray_item.cc
@@ -24,11 +24,13 @@ const char kScreenCaptureNotificationId[] = "chrome://screen/capture";
ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray)
: ScreenTrayItem(system_tray) {
+ Shell::GetInstance()->AddShellObserver(this);
Shell::GetInstance()->system_tray_notifier()->
AddScreenCaptureObserver(this);
}
ScreenCaptureTrayItem::~ScreenCaptureTrayItem() {
+ Shell::GetInstance()->RemoveShellObserver(this);
Shell::GetInstance()->system_tray_notifier()->
RemoveScreenCaptureObserver(this);
}
@@ -79,6 +81,17 @@ void ScreenCaptureTrayItem::OnScreenCaptureStart(
const base::Closure& stop_callback,
const base::string16& screen_capture_status) {
screen_capture_status_ = screen_capture_status;
+
+ // This suppression technique is currently dependent on the order
+ // that OnScreenCaptureStart and OnCastingSessionStartedOrStopped
+ // get invoked. OnCastingSessionStartedOrStopped currently gets
+ // called first.
+ //
+ // TODO(jdufault): Does this break casting and capturing the screen at the
achuithb 2015/05/06 20:02:32 Remove TODO?
jdufault 2015/05/06 21:17:33 Done.
+ // same time?
+ if (is_casting_)
+ return;
+
Start(stop_callback);
}
@@ -89,4 +102,8 @@ void ScreenCaptureTrayItem::OnScreenCaptureStop() {
Update();
}
+void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) {
+ is_casting_ = started;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698