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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 1909873002: Allow taking screen shot of a non child window which has delegate to paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 08343df886bb2e555290dd3baa23d0d758014207..1001727e427ed8f3f020f1e981c2847fa9f0fc82 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -44,7 +44,7 @@
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/touch/touch_hud_debug.h"
-#include "ash/utility/partial_screenshot_controller.h"
+#include "ash/utility/screenshot_controller.h"
#include "ash/volume_control_delegate.h"
#include "ash/wm/common/window_state.h"
#include "ash/wm/common/wm_event.h"
@@ -460,22 +460,18 @@ void HandleSwitchIme(ImeControlDelegate* ime_control_delegate,
ime_control_delegate->HandleSwitchIme(accelerator);
}
-void HandleTakeActiveWindowScreenshot(ScreenshotDelegate* screenshot_delegate) {
+void HandleTakeWindowScreenshot(ScreenshotDelegate* screenshot_delegate) {
base::RecordAction(UserMetricsAction("Accel_Take_Window_Screenshot"));
- aura::Window* active_window = wm::GetActiveWindow();
- if (!active_window)
- return;
DCHECK(screenshot_delegate);
- if (screenshot_delegate->CanTakeScreenshot())
- screenshot_delegate->HandleTakeWindowScreenshot(active_window);
+ Shell::GetInstance()->screenshot_controller()->StartWindowScreenshotSession(
+ screenshot_delegate);
}
void HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) {
base::RecordAction(UserMetricsAction("Accel_Take_Partial_Screenshot"));
DCHECK(screenshot_delegate);
- Shell::GetInstance()
- ->partial_screenshot_controller()
- ->StartPartialScreenshotSession(screenshot_delegate);
+ Shell::GetInstance()->screenshot_controller()->StartPartialScreenshotSession(
+ screenshot_delegate);
}
void HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) {
@@ -1090,7 +1086,7 @@ bool AcceleratorController::CanPerformAction(
case SHOW_KEYBOARD_OVERLAY:
case SHOW_SYSTEM_TRAY_BUBBLE:
case SHOW_TASK_MANAGER:
- case TAKE_ACTIVE_WINDOW_SCREENSHOT:
+ case TAKE_WINDOW_SCREENSHOT:
case TAKE_PARTIAL_SCREENSHOT:
case TAKE_SCREENSHOT:
case TOGGLE_FULLSCREEN:
@@ -1262,8 +1258,8 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case SWITCH_IME:
HandleSwitchIme(ime_control_delegate_.get(), accelerator);
break;
- case TAKE_ACTIVE_WINDOW_SCREENSHOT:
- HandleTakeActiveWindowScreenshot(screenshot_delegate_.get());
+ case TAKE_WINDOW_SCREENSHOT:
+ HandleTakeWindowScreenshot(screenshot_delegate_.get());
break;
case TAKE_PARTIAL_SCREENSHOT:
HandleTakePartialScreenshot(screenshot_delegate_.get());
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698