| 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/window.h" | 5 #include "ui/aura/window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 705 } |
| 706 | 706 |
| 707 void Window::SetVisible(bool visible) { | 707 void Window::SetVisible(bool visible) { |
| 708 if (visible == layer_->GetTargetVisibility()) | 708 if (visible == layer_->GetTargetVisibility()) |
| 709 return; // No change. | 709 return; // No change. |
| 710 | 710 |
| 711 FOR_EACH_OBSERVER(WindowObserver, observers_, | 711 FOR_EACH_OBSERVER(WindowObserver, observers_, |
| 712 OnWindowVisibilityChanging(this, visible)); | 712 OnWindowVisibilityChanging(this, visible)); |
| 713 | 713 |
| 714 RootWindow* root_window = GetRootWindow(); | 714 RootWindow* root_window = GetRootWindow(); |
| 715 if (client::GetVisibilityClient(root_window)) { | 715 client::VisibilityClient* visibility_client = |
| 716 client::GetVisibilityClient(root_window)->UpdateLayerVisibility( | 716 client::GetVisibilityClient(this); |
| 717 this, visible); | 717 if (visibility_client) |
| 718 } else { | 718 visibility_client->UpdateLayerVisibility(this, visible); |
| 719 else |
| 719 layer_->SetVisible(visible); | 720 layer_->SetVisible(visible); |
| 720 } | |
| 721 visible_ = visible; | 721 visible_ = visible; |
| 722 SchedulePaint(); | 722 SchedulePaint(); |
| 723 if (parent_ && parent_->layout_manager_.get()) | 723 if (parent_ && parent_->layout_manager_.get()) |
| 724 parent_->layout_manager_->OnChildWindowVisibilityChanged(this, visible); | 724 parent_->layout_manager_->OnChildWindowVisibilityChanged(this, visible); |
| 725 | 725 |
| 726 if (delegate_) | 726 if (delegate_) |
| 727 delegate_->OnWindowTargetVisibilityChanged(visible); | 727 delegate_->OnWindowTargetVisibilityChanged(visible); |
| 728 | 728 |
| 729 NotifyWindowVisibilityChanged(this, visible); | 729 NotifyWindowVisibilityChanged(this, visible); |
| 730 | 730 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 bool contains_mouse = false; | 1091 bool contains_mouse = false; |
| 1092 if (IsVisible()) { | 1092 if (IsVisible()) { |
| 1093 RootWindow* root_window = GetRootWindow(); | 1093 RootWindow* root_window = GetRootWindow(); |
| 1094 contains_mouse = root_window && | 1094 contains_mouse = root_window && |
| 1095 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); | 1095 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); |
| 1096 } | 1096 } |
| 1097 return contains_mouse; | 1097 return contains_mouse; |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 } // namespace aura | 1100 } // namespace aura |
| OLD | NEW |