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 "chrome/browser/ui/views/tabs/tab_drag_controller.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 SetWindowPositionManaged(widget->GetNativeWindow(), false); | 140 SetWindowPositionManaged(widget->GetNativeWindow(), false); |
141 } | 141 } |
142 }; | 142 }; |
143 | 143 |
144 // EscapeTracker installs an event monitor and runs a callback when it receives | 144 // EscapeTracker installs an event monitor and runs a callback when it receives |
145 // the escape key. | 145 // the escape key. |
146 class EscapeTracker : public ui::EventHandler { | 146 class EscapeTracker : public ui::EventHandler { |
147 public: | 147 public: |
148 explicit EscapeTracker(const base::Closure& callback) | 148 explicit EscapeTracker(const base::Closure& callback) |
149 : escape_callback_(callback), | 149 : escape_callback_(callback), |
150 event_monitor_(views::EventMonitor::Create(this)) { | 150 event_monitor_(views::EventMonitor::CreateApplicationMonitor(this)) { |
151 } | 151 } |
152 | 152 |
153 private: | 153 private: |
154 // ui::EventHandler: | 154 // ui::EventHandler: |
155 void OnKeyEvent(ui::KeyEvent* key) override { | 155 void OnKeyEvent(ui::KeyEvent* key) override { |
156 if (key->type() == ui::ET_KEY_PRESSED && | 156 if (key->type() == ui::ET_KEY_PRESSED && |
157 key->key_code() == ui::VKEY_ESCAPE) { | 157 key->key_code() == ui::VKEY_ESCAPE) { |
158 escape_callback_.Run(); | 158 escape_callback_.Run(); |
159 } | 159 } |
160 } | 160 } |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 it != browser_list->end(); ++it) { | 1803 it != browser_list->end(); ++it) { |
1804 if ((*it)->tab_strip_model()->empty()) | 1804 if ((*it)->tab_strip_model()->empty()) |
1805 exclude.insert((*it)->window()->GetNativeWindow()); | 1805 exclude.insert((*it)->window()->GetNativeWindow()); |
1806 } | 1806 } |
1807 #endif | 1807 #endif |
1808 return GetLocalProcessWindowAtPoint(host_desktop_type_, | 1808 return GetLocalProcessWindowAtPoint(host_desktop_type_, |
1809 screen_point, | 1809 screen_point, |
1810 exclude); | 1810 exclude); |
1811 | 1811 |
1812 } | 1812 } |
OLD | NEW |