| 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/time.h" | 5 #include "base/time.h" |
| 6 #include "base/timer.h" | 6 #include "base/timer.h" |
| 7 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 7 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| 8 #include "ui/gfx/screen.h" | 8 #include "ui/gfx/screen.h" |
| 9 | 9 |
| 10 // A timer based implementation of PanelMouseWatcher. Currently used for Gtk | 10 // A timer based implementation of PanelMouseWatcher. Currently used for Gtk |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void PanelMouseWatcherTimer::Stop() { | 58 void PanelMouseWatcherTimer::Stop() { |
| 59 DCHECK(IsActive()); | 59 DCHECK(IsActive()); |
| 60 timer_.Stop(); | 60 timer_.Stop(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool PanelMouseWatcherTimer::IsActive() const { | 63 bool PanelMouseWatcherTimer::IsActive() const { |
| 64 return timer_.IsRunning(); | 64 return timer_.IsRunning(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 gfx::Point PanelMouseWatcherTimer::GetMousePosition() const { | 67 gfx::Point PanelMouseWatcherTimer::GetMousePosition() const { |
| 68 return gfx::Screen::GetCursorScreenPoint(); | 68 // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 |
| 69 return gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void PanelMouseWatcherTimer::DoWork() { | 72 void PanelMouseWatcherTimer::DoWork() { |
| 72 NotifyMouseMovement(GetMousePosition()); | 73 NotifyMouseMovement(GetMousePosition()); |
| 73 } | 74 } |
| OLD | NEW |