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

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

Issue 2271393002: Wires up drags to pointer watcher adapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 8 errors. 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 | « ash/common/shelf/shelf_tooltip_manager.cc ('k') | ash/common/system/tray/tray_event_filter.cc » ('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/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"
(...skipping 17 matching lines...) Expand all
28 } // namespace 28 } // namespace
29 29
30 LaserPointerMode::LaserPointerMode(Delegate* delegate) 30 LaserPointerMode::LaserPointerMode(Delegate* delegate)
31 : CommonPaletteTool(delegate) { 31 : CommonPaletteTool(delegate) {
32 laser_pointer_view_.reset(new LaserPointerView( 32 laser_pointer_view_.reset(new LaserPointerView(
33 base::TimeDelta::FromMilliseconds(kPointLifeDurationMs))); 33 base::TimeDelta::FromMilliseconds(kPointLifeDurationMs)));
34 timer_.reset(new base::Timer( 34 timer_.reset(new base::Timer(
35 FROM_HERE, base::TimeDelta::FromMilliseconds(kAddStationaryPointsDelayMs), 35 FROM_HERE, base::TimeDelta::FromMilliseconds(kAddStationaryPointsDelayMs),
36 base::Bind(&LaserPointerMode::AddStationaryPoint, base::Unretained(this)), 36 base::Bind(&LaserPointerMode::AddStationaryPoint, base::Unretained(this)),
37 true)); 37 true));
38 WmShell::Get()->AddPointerWatcher(this, true); 38 WmShell::Get()->AddPointerWatcher(this,
39 views::PointerWatcherEventTypes::DRAGS);
39 } 40 }
40 41
41 LaserPointerMode::~LaserPointerMode() { 42 LaserPointerMode::~LaserPointerMode() {
42 OnDisable(); 43 OnDisable();
43 WmShell::Get()->RemovePointerWatcher(this); 44 WmShell::Get()->RemovePointerWatcher(this);
44 } 45 }
45 46
46 PaletteGroup LaserPointerMode::GetGroup() const { 47 PaletteGroup LaserPointerMode::GetGroup() const {
47 return PaletteGroup::MODE; 48 return PaletteGroup::MODE;
48 } 49 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 current_mouse_location_ = location_in_screen; 106 current_mouse_location_ = location_in_screen;
106 if (enabled()) { 107 if (enabled()) {
107 laser_pointer_view_->AddNewPoint(current_mouse_location_); 108 laser_pointer_view_->AddNewPoint(current_mouse_location_);
108 timer_repeat_count_ = 0; 109 timer_repeat_count_ = 0;
109 if (!timer_->IsRunning()) 110 if (!timer_->IsRunning())
110 timer_->Reset(); 111 timer_->Reset();
111 } 112 }
112 } 113 }
113 } 114 }
114 } // namespace ash 115 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_tooltip_manager.cc ('k') | ash/common/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698