OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
7 #include "base/timer/timer.h" | 7 #include "base/timer/timer.h" |
8 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 8 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
9 #include "ui/gfx/screen.h" | 9 #include "ui/display/screen.h" |
10 | 10 |
11 // A timer based implementation of PanelMouseWatcher. Currently used for Gtk | 11 // A timer based implementation of PanelMouseWatcher. Currently used for Gtk |
12 // and Mac panels implementations. | 12 // and Mac panels implementations. |
13 class PanelMouseWatcherTimer : public PanelMouseWatcher { | 13 class PanelMouseWatcherTimer : public PanelMouseWatcher { |
14 public: | 14 public: |
15 PanelMouseWatcherTimer(); | 15 PanelMouseWatcherTimer(); |
16 ~PanelMouseWatcherTimer() override; | 16 ~PanelMouseWatcherTimer() override; |
17 | 17 |
18 private: | 18 private: |
19 void Start() override; | 19 void Start() override; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void PanelMouseWatcherTimer::Stop() { | 59 void PanelMouseWatcherTimer::Stop() { |
60 DCHECK(IsActive()); | 60 DCHECK(IsActive()); |
61 timer_.Stop(); | 61 timer_.Stop(); |
62 } | 62 } |
63 | 63 |
64 bool PanelMouseWatcherTimer::IsActive() const { | 64 bool PanelMouseWatcherTimer::IsActive() const { |
65 return timer_.IsRunning(); | 65 return timer_.IsRunning(); |
66 } | 66 } |
67 | 67 |
68 gfx::Point PanelMouseWatcherTimer::GetMousePosition() const { | 68 gfx::Point PanelMouseWatcherTimer::GetMousePosition() const { |
69 return gfx::Screen::GetScreen()->GetCursorScreenPoint(); | 69 return display::Screen::GetScreen()->GetCursorScreenPoint(); |
70 } | 70 } |
71 | 71 |
72 void PanelMouseWatcherTimer::DoWork() { | 72 void PanelMouseWatcherTimer::DoWork() { |
73 NotifyMouseMovement(GetMousePosition()); | 73 NotifyMouseMovement(GetMousePosition()); |
74 } | 74 } |
OLD | NEW |