blob: f1200e6322555a48cf20fff8f574096f890aca03 [file] [log] [blame]
jdufaulte18aeb22016-08-24 00:46:351// Copyright 2016 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
James Cooka35a1e22017-04-08 02:33:085#include "ash/system/palette/tools/capture_screen_action.h"
jdufaulte18aeb22016-08-24 00:46:356
estade81c69852016-09-08 21:25:597#include "ash/resources/vector_icons/vector_icons.h"
sky07a24d42017-03-09 23:57:308#include "ash/shell.h"
jamescooke45f8112017-03-02 16:45:429#include "ash/strings/grit/ash_strings.h"
James Cooka35a1e22017-04-08 02:33:0810#include "ash/system/palette/palette_ids.h"
James Cook5e9d3402017-11-01 00:20:1211#include "ash/utility/screenshot_controller.h"
jdufaulte18aeb22016-08-24 00:46:3512#include "ui/base/l10n/l10n_util.h"
13
14namespace ash {
15
16CaptureScreenAction::CaptureScreenAction(Delegate* delegate)
17 : CommonPaletteTool(delegate) {}
18
Chris Watkinsc24daf62017-11-28 03:43:0919CaptureScreenAction::~CaptureScreenAction() = default;
jdufaulte18aeb22016-08-24 00:46:3520
21PaletteGroup CaptureScreenAction::GetGroup() const {
22 return PaletteGroup::ACTION;
23}
24
25PaletteToolId CaptureScreenAction::GetToolId() const {
26 return PaletteToolId::CAPTURE_SCREEN;
27}
28
29void CaptureScreenAction::OnEnable() {
30 CommonPaletteTool::OnEnable();
31
jdufaulte18aeb22016-08-24 00:46:3532 delegate()->DisableTool(GetToolId());
jdufaulta4d53242016-11-10 00:29:1133 delegate()->HidePaletteImmediately();
Vladislav Kaznacheevfc6220832017-10-12 20:07:3834
James Cook5e9d3402017-11-01 00:20:1235 Shell::Get()->screenshot_controller()->TakeScreenshotForAllRootWindows();
jdufaulte18aeb22016-08-24 00:46:3536}
37
38views::View* CaptureScreenAction::CreateView() {
39 return CreateDefaultView(
jdufault6546a0d12016-08-26 04:27:5440 l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_CAPTURE_SCREEN_ACTION));
jdufaulte18aeb22016-08-24 00:46:3541}
42
estade81c69852016-09-08 21:25:5943const gfx::VectorIcon& CaptureScreenAction::GetPaletteIcon() const {
44 return kPaletteActionCaptureScreenIcon;
jdufaulte18aeb22016-08-24 00:46:3545}
46
47} // namespace ash