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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 void RootWindow::AdvanceQueuedTouchEvent(Window* window, bool processed) { | 400 void RootWindow::AdvanceQueuedTouchEvent(Window* window, bool processed) { |
401 scoped_ptr<GestureRecognizer::Gestures> gestures; | 401 scoped_ptr<GestureRecognizer::Gestures> gestures; |
402 gestures.reset(gesture_recognizer_->AdvanceTouchQueue(window, processed)); | 402 gestures.reset(gesture_recognizer_->AdvanceTouchQueue(window, processed)); |
403 ProcessGestures(gestures.get()); | 403 ProcessGestures(gestures.get()); |
404 } | 404 } |
405 | 405 |
406 void RootWindow::SetGestureRecognizerForTesting(GestureRecognizer* gr) { | 406 void RootWindow::SetGestureRecognizerForTesting(GestureRecognizer* gr) { |
407 gesture_recognizer_.reset(gr); | 407 gesture_recognizer_.reset(gr); |
408 } | 408 } |
409 | 409 |
| 410 #if !defined(NDEBUG) |
| 411 void RootWindow::ToggleFullScreen() { |
| 412 host_->ToggleFullScreen(); |
| 413 } |
| 414 #endif |
| 415 |
| 416 RootWindow* RootWindow::GetRootWindow() { |
| 417 return this; |
| 418 } |
| 419 |
410 void RootWindow::SetTransform(const ui::Transform& transform) { | 420 void RootWindow::SetTransform(const ui::Transform& transform) { |
411 Window::SetTransform(transform); | 421 Window::SetTransform(transform); |
412 | 422 |
413 // If the layer is not animating, then we need to update the host size | 423 // If the layer is not animating, then we need to update the host size |
414 // immediately. | 424 // immediately. |
415 if (!layer()->GetAnimator()->is_animating()) | 425 if (!layer()->GetAnimator()->is_animating()) |
416 OnHostResized(host_->GetSize()); | 426 OnHostResized(host_->GetSize()); |
417 } | 427 } |
418 | 428 |
419 #if !defined(NDEBUG) | |
420 void RootWindow::ToggleFullScreen() { | |
421 host_->ToggleFullScreen(); | |
422 } | |
423 #endif | |
424 | |
425 //////////////////////////////////////////////////////////////////////////////// | 429 //////////////////////////////////////////////////////////////////////////////// |
426 // RootWindow, private: | 430 // RootWindow, private: |
427 | 431 |
428 RootWindow::RootWindow() | 432 RootWindow::RootWindow() |
429 : Window(NULL), | 433 : Window(NULL), |
430 host_(aura::RootWindowHost::Create(GetInitialHostWindowBounds())), | 434 host_(aura::RootWindowHost::Create(GetInitialHostWindowBounds())), |
431 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)), | 435 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)), |
432 ALLOW_THIS_IN_INITIALIZER_LIST(event_factory_(this)), | 436 ALLOW_THIS_IN_INITIALIZER_LIST(event_factory_(this)), |
433 mouse_button_flags_(0), | 437 mouse_button_flags_(0), |
434 last_cursor_(kCursorNull), | 438 last_cursor_(kCursorNull), |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 } | 624 } |
621 | 625 |
622 bool RootWindow::CanReceiveEvents() const { | 626 bool RootWindow::CanReceiveEvents() const { |
623 return IsVisible(); | 627 return IsVisible(); |
624 } | 628 } |
625 | 629 |
626 internal::FocusManager* RootWindow::GetFocusManager() { | 630 internal::FocusManager* RootWindow::GetFocusManager() { |
627 return this; | 631 return this; |
628 } | 632 } |
629 | 633 |
630 RootWindow* RootWindow::GetRootWindow() { | |
631 return this; | |
632 } | |
633 | |
634 void RootWindow::OnWindowDetachingFromRootWindow(Window* detached) { | 634 void RootWindow::OnWindowDetachingFromRootWindow(Window* detached) { |
635 DCHECK(capture_window_ != this); | 635 DCHECK(capture_window_ != this); |
636 | 636 |
637 // If the ancestor of the capture window is detached, | 637 // If the ancestor of the capture window is detached, |
638 // release the capture. | 638 // release the capture. |
639 if (detached->Contains(capture_window_) && detached != this) | 639 if (detached->Contains(capture_window_) && detached != this) |
640 ReleaseCapture(capture_window_); | 640 ReleaseCapture(capture_window_); |
641 | 641 |
642 // If the ancestor of the focused window is detached, | 642 // If the ancestor of the focused window is detached, |
643 // release the focus. | 643 // release the focus. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's | 758 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's |
759 // is currently broken. See/ crbug.com/107931. | 759 // is currently broken. See/ crbug.com/107931. |
760 MouseEvent event(ui::ET_MOUSE_MOVED, | 760 MouseEvent event(ui::ET_MOUSE_MOVED, |
761 orig_mouse_location, | 761 orig_mouse_location, |
762 orig_mouse_location, | 762 orig_mouse_location, |
763 0); | 763 0); |
764 DispatchMouseEvent(&event); | 764 DispatchMouseEvent(&event); |
765 } | 765 } |
766 | 766 |
767 } // namespace aura | 767 } // namespace aura |
OLD | NEW |