summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_commands_chromeos.cc
blob: c955b67ca495d2ec6563b081a0053c6f105de606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/browser_commands_chromeos.h"

#include "ash/accelerators/accelerator_controller.h"
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
#include "base/metrics/user_metrics_action.h"
#include "content/public/browser/user_metrics.h"

using base::UserMetricsAction;

namespace chrome {

void TakeScreenshot() {
  content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
  ash::ScreenshotDelegate* screenshot_delegate = ash::Shell::GetInstance()->
      accelerator_controller()->screenshot_delegate();
  if (screenshot_delegate &&
      screenshot_delegate->CanTakeScreenshot()) {
    screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
  }
}

}  // namespace chrome