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

Unified Diff: ash/utility/screenshot_controller.cc

Issue 2324803003: cros/ash: Cancel screenshot mode if screenshot is cancelled or not taken. (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « ash/utility/screenshot_controller.h ('k') | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/utility/screenshot_controller.cc
diff --git a/ash/utility/screenshot_controller.cc b/ash/utility/screenshot_controller.cc
index cfc98c195b6d16e173ead4c6d0d163056f21d046..b4ea619b31e06692cb4a7e37f15ee34d2d9378fc 100644
--- a/ash/utility/screenshot_controller.cc
+++ b/ash/utility/screenshot_controller.cc
@@ -308,6 +308,14 @@ void ScreenshotController::CancelScreenshotSession() {
base::STLDeleteValues(&layers_);
cursor_setter_.reset();
EnableMouseWarp(true);
+
+ if (on_screenshot_session_done_) {
+ // Copy the closure to a temporary value so that if it calls
+ // CancelScreenshotSession we do not loop forever.
+ base::Closure on_done = on_screenshot_session_done_;
+ on_screenshot_session_done_.Reset();
+ on_done.Run();
+ }
}
void ScreenshotController::MaybeStart(const ui::LocatedEvent& event) {
« no previous file with comments | « ash/utility/screenshot_controller.h ('k') | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698