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

Side by Side Diff: ash/common/system/chromeos/palette/tools/capture_region_mode.cc

Issue 2324803003: cros/ash: Cancel screenshot mode if screenshot is cancelled or not taken. (Closed)
Patch Set: Rebase Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/palette/tools/capture_region_mode.h" 5 #include "ash/common/system/chromeos/palette/tools/capture_region_mode.h"
6 6
7 #include "ash/common/accelerators/accelerator_controller.h" 7 #include "ash/common/accelerators/accelerator_controller.h"
8 #include "ash/common/palette_delegate.h" 8 #include "ash/common/palette_delegate.h"
9 #include "ash/common/system/chromeos/palette/palette_ids.h" 9 #include "ash/common/system/chromeos/palette/palette_ids.h"
10 #include "ash/common/system/toast/toast_data.h" 10 #include "ash/common/system/toast/toast_data.h"
(...skipping 19 matching lines...) Expand all
30 30
31 PaletteGroup CaptureRegionMode::GetGroup() const { 31 PaletteGroup CaptureRegionMode::GetGroup() const {
32 return PaletteGroup::MODE; 32 return PaletteGroup::MODE;
33 } 33 }
34 34
35 PaletteToolId CaptureRegionMode::GetToolId() const { 35 PaletteToolId CaptureRegionMode::GetToolId() const {
36 return PaletteToolId::CAPTURE_REGION; 36 return PaletteToolId::CAPTURE_REGION;
37 } 37 }
38 38
39 const gfx::VectorIcon& CaptureRegionMode::GetActiveTrayIcon() const { 39 const gfx::VectorIcon& CaptureRegionMode::GetActiveTrayIcon() const {
40 // TODO(jdufault): Update to real icon once new tray icons are ready. 40 return kPaletteTrayIconCaptureRegionIcon;
41 return kPaletteTrayIconMagnifyIcon;
42 } 41 }
43 42
44 void CaptureRegionMode::OnEnable() { 43 void CaptureRegionMode::OnEnable() {
45 CommonPaletteTool::OnEnable(); 44 CommonPaletteTool::OnEnable();
46 45
47 ToastData toast(kToastId, l10n_util::GetStringUTF16( 46 ToastData toast(kToastId, l10n_util::GetStringUTF16(
48 IDS_ASH_STYLUS_TOOLS_CAPTURE_REGION_TOAST), 47 IDS_ASH_STYLUS_TOOLS_CAPTURE_REGION_TOAST),
49 kToastDurationMs, base::string16()); 48 kToastDurationMs, base::string16());
50 ash::WmShell::Get()->toast_manager()->Show(toast); 49 ash::WmShell::Get()->toast_manager()->Show(toast);
51 50
(...skipping 18 matching lines...) Expand all
70 const gfx::VectorIcon& CaptureRegionMode::GetPaletteIcon() const { 69 const gfx::VectorIcon& CaptureRegionMode::GetPaletteIcon() const {
71 return kPaletteActionCaptureRegionIcon; 70 return kPaletteActionCaptureRegionIcon;
72 } 71 }
73 72
74 void CaptureRegionMode::OnScreenshotDone() { 73 void CaptureRegionMode::OnScreenshotDone() {
75 // The screenshot finished, so disable the tool. 74 // The screenshot finished, so disable the tool.
76 delegate()->DisableTool(GetToolId()); 75 delegate()->DisableTool(GetToolId());
77 } 76 }
78 77
79 } // namespace ash 78 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698