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

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

Issue 2316183003: Move a bunch of ash-only vector icons to ash/. (Closed)
Patch Set: drop the "id". Just "icon". It's cleaner. 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
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/laser_pointer_mode.h" 5 #include "ash/common/system/chromeos/palette/tools/laser_pointer_mode.h"
6 6
7 #include "ash/common/palette_delegate.h" 7 #include "ash/common/palette_delegate.h"
8 #include "ash/common/system/chromeos/palette/palette_ids.h" 8 #include "ash/common/system/chromeos/palette/palette_ids.h"
9 #include "ash/common/system/chromeos/palette/tools/laser_pointer_view.h" 9 #include "ash/common/system/chromeos/palette/tools/laser_pointer_view.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
11 #include "ash/resources/vector_icons/vector_icons.h"
11 #include "grit/ash_strings.h" 12 #include "grit/ash_strings.h"
12 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/wm/core/coordinate_conversion.h" 14 #include "ui/wm/core/coordinate_conversion.h"
14 #include "ui/wm/core/cursor_manager.h" 15 #include "ui/wm/core/cursor_manager.h"
15 16
16 namespace ash { 17 namespace ash {
17 namespace { 18 namespace {
18 19
19 // A point gets removed from the collection if it is older than 20 // A point gets removed from the collection if it is older than
20 // |kPointLifeDurationMs|. 21 // |kPointLifeDurationMs|.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 61 }
61 62
62 void LaserPointerMode::OnDisable() { 63 void LaserPointerMode::OnDisable() {
63 CommonPaletteTool::OnDisable(); 64 CommonPaletteTool::OnDisable();
64 65
65 WmShell::Get()->palette_delegate()->OnLaserPointerDisabled(); 66 WmShell::Get()->palette_delegate()->OnLaserPointerDisabled();
66 StopTimer(); 67 StopTimer();
67 laser_pointer_view_->Stop(); 68 laser_pointer_view_->Stop();
68 } 69 }
69 70
70 gfx::VectorIconId LaserPointerMode::GetActiveTrayIcon() { 71 const gfx::VectorIcon& LaserPointerMode::GetActiveTrayIcon() const {
71 return gfx::VectorIconId::PALETTE_TRAY_ICON_LASER_POINTER; 72 return kPaletteTrayIconLaserPointerIcon;
72 } 73 }
73 74
74 gfx::VectorIconId LaserPointerMode::GetPaletteIconId() { 75 const gfx::VectorIcon& LaserPointerMode::GetPaletteIcon() const {
75 return gfx::VectorIconId::PALETTE_MODE_LASER_POINTER; 76 return kPaletteModeLaserPointerIcon;
76 } 77 }
77 78
78 views::View* LaserPointerMode::CreateView() { 79 views::View* LaserPointerMode::CreateView() {
79 return CreateDefaultView( 80 return CreateDefaultView(
80 l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_LASER_POINTER_MODE)); 81 l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_LASER_POINTER_MODE));
81 } 82 }
82 83
83 void LaserPointerMode::StopTimer() { 84 void LaserPointerMode::StopTimer() {
84 timer_repeat_count_ = 0; 85 timer_repeat_count_ = 0;
85 timer_->Stop(); 86 timer_->Stop();
(...skipping 20 matching lines...) Expand all
106 current_mouse_location_ = location_in_screen; 107 current_mouse_location_ = location_in_screen;
107 if (enabled()) { 108 if (enabled()) {
108 laser_pointer_view_->AddNewPoint(current_mouse_location_); 109 laser_pointer_view_->AddNewPoint(current_mouse_location_);
109 timer_repeat_count_ = 0; 110 timer_repeat_count_ = 0;
110 if (!timer_->IsRunning()) 111 if (!timer_->IsRunning())
111 timer_->Reset(); 112 timer_->Reset();
112 } 113 }
113 } 114 }
114 } 115 }
115 } // namespace ash 116 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698