blob: ecb2f69b71856ce626acfc050f3e759809d665dd [file] [log] [blame]
caelyn4e4e08a2015-02-04 21:27:491// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/ui/browser_commands_chromeos.h"
6
sky44a09892016-07-20 17:46:587#include "ash/accelerators/accelerator_controller_delegate_aura.h"
caelyn4e4e08a2015-02-04 21:27:498#include "ash/metrics/user_metrics_recorder.h"
9#include "ash/screenshot_delegate.h"
10#include "ash/shell.h"
11#include "base/metrics/user_metrics_action.h"
12#include "content/public/browser/user_metrics.h"
13
14using base::UserMetricsAction;
15
16void TakeScreenshot() {
17 content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
sky44a09892016-07-20 17:46:5818 ash::ScreenshotDelegate* screenshot_delegate =
19 ash::Shell::GetInstance()
20 ->accelerator_controller_delegate()
21 ->screenshot_delegate();
caelyn4e4e08a2015-02-04 21:27:4922 if (screenshot_delegate &&
23 screenshot_delegate->CanTakeScreenshot()) {
24 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
25 }
26}