OLD | NEW |
| (Empty) |
1 // 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 | |
5 #include "ash/common/system/chromeos/palette/tools/laser_pointer_mode.h" | |
6 | |
7 #include "ash/common/palette_delegate.h" | |
8 #include "ash/common/system/chromeos/palette/palette_ids.h" | |
9 #include "ash/common/wm_shell.h" | |
10 #include "ash/resources/vector_icons/vector_icons.h" | |
11 #include "ash/strings/grit/ash_strings.h" | |
12 #include "ui/base/l10n/l10n_util.h" | |
13 | |
14 namespace ash { | |
15 | |
16 LaserPointerMode::LaserPointerMode(Delegate* delegate) | |
17 : CommonPaletteTool(delegate) { | |
18 } | |
19 | |
20 LaserPointerMode::~LaserPointerMode() {} | |
21 | |
22 PaletteGroup LaserPointerMode::GetGroup() const { | |
23 return PaletteGroup::MODE; | |
24 } | |
25 | |
26 PaletteToolId LaserPointerMode::GetToolId() const { | |
27 return PaletteToolId::LASER_POINTER; | |
28 } | |
29 | |
30 void LaserPointerMode::OnEnable() { | |
31 CommonPaletteTool::OnEnable(); | |
32 | |
33 WmShell::Get()->SetLaserPointerEnabled(true); | |
34 delegate()->HidePalette(); | |
35 } | |
36 | |
37 void LaserPointerMode::OnDisable() { | |
38 CommonPaletteTool::OnDisable(); | |
39 | |
40 WmShell::Get()->SetLaserPointerEnabled(false); | |
41 } | |
42 | |
43 const gfx::VectorIcon& LaserPointerMode::GetActiveTrayIcon() const { | |
44 return kPaletteTrayIconLaserPointerIcon; | |
45 } | |
46 | |
47 const gfx::VectorIcon& LaserPointerMode::GetPaletteIcon() const { | |
48 return kPaletteModeLaserPointerIcon; | |
49 } | |
50 | |
51 views::View* LaserPointerMode::CreateView() { | |
52 return CreateDefaultView( | |
53 l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_LASER_POINTER_MODE)); | |
54 } | |
55 } // namespace ash | |
OLD | NEW |