OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 capture_window_ = window; | 422 capture_window_ = window; |
423 | 423 |
424 if (capture_window_) { | 424 if (capture_window_) { |
425 // Make all subsequent mouse events and touch go to the capture window. We | 425 // Make all subsequent mouse events and touch go to the capture window. We |
426 // shouldn't need to send an event here as OnCaptureLost should take care of | 426 // shouldn't need to send an event here as OnCaptureLost should take care of |
427 // that. | 427 // that. |
428 if (mouse_pressed_handler_) | 428 if (mouse_pressed_handler_) |
429 mouse_pressed_handler_ = capture_window_; | 429 mouse_pressed_handler_ = capture_window_; |
430 if (touch_event_handler_) | 430 if (touch_event_handler_) |
431 touch_event_handler_ = capture_window_; | 431 touch_event_handler_ = capture_window_; |
| 432 } else { |
| 433 // When capture is lost, we must reset the event handlers. |
| 434 mouse_pressed_handler_ = NULL; |
| 435 touch_event_handler_ = NULL; |
432 } | 436 } |
433 } | 437 } |
434 | 438 |
435 void Desktop::ReleaseCapture(Window* window) { | 439 void Desktop::ReleaseCapture(Window* window) { |
436 if (capture_window_ != window) | 440 if (capture_window_ != window) |
437 return; | 441 return; |
438 SetCapture(NULL); | 442 SetCapture(NULL); |
439 } | 443 } |
440 | 444 |
441 void Desktop::SetTransform(const ui::Transform& transform) { | 445 void Desktop::SetTransform(const ui::Transform& transform) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 610 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
607 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 611 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
608 } else if (use_fullscreen_host_window_) { | 612 } else if (use_fullscreen_host_window_) { |
609 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 613 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
610 } | 614 } |
611 | 615 |
612 return bounds; | 616 return bounds; |
613 } | 617 } |
614 | 618 |
615 } // namespace aura | 619 } // namespace aura |
OLD | NEW |