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

Unified Diff: ash/utility/screenshot_controller.h

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
Index: ash/utility/screenshot_controller.h
diff --git a/ash/utility/screenshot_controller.h b/ash/utility/screenshot_controller.h
index 8416bbd3d2731dcf0334d87e81caa4bc358a2a52..65a6466654bd5b0fa23dfc88daf9ffe986d07780 100644
--- a/ash/utility/screenshot_controller.h
+++ b/ash/utility/screenshot_controller.h
@@ -12,6 +12,7 @@
#include "ash/ash_export.h"
#include "ash/common/shell_observer.h"
+#include "base/callback.h"
#include "base/macros.h"
#include "ui/aura/window_observer.h"
#include "ui/display/display_observer.h"
@@ -57,6 +58,13 @@ class ASH_EXPORT ScreenshotController : public ui::EventHandler,
// Cancels any active screenshot session.
void CancelScreenshotSession();
+ // Set a function that will be called when the current screenshot session has
+ // been completed or cancelled. This is reset after the screenshot session is
+ // done.
+ void set_on_screenshot_session_done(const base::Closure& on_done) {
+ on_screenshot_session_done_ = on_done;
+ }
+
// If set to true, then only events generated by a pen can be used to select
// the area to take a screenshot of. This is reset to false after a screenshot
// operation is completed.
@@ -108,6 +116,8 @@ class ASH_EXPORT ScreenshotController : public ui::EventHandler,
// screenshot region.
bool pen_events_only_ = false;
+ base::Closure on_screenshot_session_done_;
+
// The data to build the screenshot region.
gfx::Point start_position_;
aura::Window* root_window_;
« no previous file with comments | « ash/resources/vector_icons/palette_tray_icon_capture_region.1x.icon ('k') | ash/utility/screenshot_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698