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/views/widget/root_view.h" | 5 #include "ui/views/widget/root_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 gesture_handler_ = new_mh; | 583 gesture_handler_ = new_mh; |
584 scroll_gesture_handler_ = new_mh; | 584 scroll_gesture_handler_ = new_mh; |
585 drag_info_.Reset(); | 585 drag_info_.Reset(); |
586 } | 586 } |
587 | 587 |
588 void RootView::GetAccessibleState(ui::AccessibleViewState* state) { | 588 void RootView::GetAccessibleState(ui::AccessibleViewState* state) { |
589 state->name = widget_->widget_delegate()->GetAccessibleWindowTitle(); | 589 state->name = widget_->widget_delegate()->GetAccessibleWindowTitle(); |
590 state->role = widget_->widget_delegate()->GetAccessibleWindowRole(); | 590 state->role = widget_->widget_delegate()->GetAccessibleWindowRole(); |
591 } | 591 } |
592 | 592 |
593 void RootView::ReorderChildLayers(ui::Layer* parent_layer) { | 593 void RootView::UpdateParentLayer() { |
594 View::ReorderChildLayers(parent_layer); | 594 if (layer()) |
| 595 ReparentLayer(gfx::Vector2d(GetMirroredX(), y()), widget_->GetLayer()); |
595 } | 596 } |
596 | 597 |
597 //////////////////////////////////////////////////////////////////////////////// | 598 //////////////////////////////////////////////////////////////////////////////// |
598 // RootView, protected: | 599 // RootView, protected: |
599 | 600 |
600 void RootView::ViewHierarchyChanged( | 601 void RootView::ViewHierarchyChanged( |
601 const ViewHierarchyChangedDetails& details) { | 602 const ViewHierarchyChangedDetails& details) { |
602 widget_->ViewHierarchyChanged(details); | 603 widget_->ViewHierarchyChanged(details); |
603 | 604 |
604 if (!details.is_add) { | 605 if (!details.is_add) { |
(...skipping 19 matching lines...) Expand all Loading... |
624 // TODO (pkotwicz): Remove this once we switch over to Aura desktop. | 625 // TODO (pkotwicz): Remove this once we switch over to Aura desktop. |
625 // This is needed so that we can set the background behind the RWHV when the | 626 // This is needed so that we can set the background behind the RWHV when the |
626 // RWHV is not visible. Not needed once there is a view between the RootView | 627 // RWHV is not visible. Not needed once there is a view between the RootView |
627 // and RWHV. | 628 // and RWHV. |
628 View::OnPaint(canvas); | 629 View::OnPaint(canvas); |
629 } | 630 } |
630 | 631 |
631 gfx::Vector2d RootView::CalculateOffsetToAncestorWithLayer( | 632 gfx::Vector2d RootView::CalculateOffsetToAncestorWithLayer( |
632 ui::Layer** layer_parent) { | 633 ui::Layer** layer_parent) { |
633 gfx::Vector2d offset(View::CalculateOffsetToAncestorWithLayer(layer_parent)); | 634 gfx::Vector2d offset(View::CalculateOffsetToAncestorWithLayer(layer_parent)); |
634 if (!layer()) | 635 if (!layer() && layer_parent) |
635 offset += widget_->CalculateOffsetToAncestorWithLayer(layer_parent); | 636 *layer_parent = widget_->GetLayer(); |
636 return offset; | 637 return offset; |
637 } | 638 } |
638 | 639 |
639 View::DragInfo* RootView::GetDragInfo() { | 640 View::DragInfo* RootView::GetDragInfo() { |
640 return &drag_info_; | 641 return &drag_info_; |
641 } | 642 } |
642 | 643 |
643 //////////////////////////////////////////////////////////////////////////////// | 644 //////////////////////////////////////////////////////////////////////////////// |
644 // RootView, private: | 645 // RootView, private: |
645 | 646 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 DispatchEventToTarget(p, ¬ify_event); | 683 DispatchEventToTarget(p, ¬ify_event); |
683 } | 684 } |
684 } | 685 } |
685 | 686 |
686 bool RootView::CanDispatchToTarget(ui::EventTarget* target) { | 687 bool RootView::CanDispatchToTarget(ui::EventTarget* target) { |
687 return event_dispatch_target_ == target; | 688 return event_dispatch_target_ == target; |
688 } | 689 } |
689 | 690 |
690 } // namespace internal | 691 } // namespace internal |
691 } // namespace views | 692 } // namespace views |
OLD | NEW |