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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 layer_->set_delegate(this); | 156 layer_->set_delegate(this); |
157 layer_->SetMasksToBounds(old_layer->GetMasksToBounds()); | 157 layer_->SetMasksToBounds(old_layer->GetMasksToBounds()); |
158 // Move the original texture to the new layer if the old layer has a | 158 // Move the original texture to the new layer if the old layer has a |
159 // texture and we could copy it into the old layer, | 159 // texture and we could copy it into the old layer, |
160 // crbug.com/175211. | 160 // crbug.com/175211. |
161 if (delegate_ && old_texture) | 161 if (delegate_ && old_texture) |
162 layer_->SetExternalTexture(old_texture); | 162 layer_->SetExternalTexture(old_texture); |
163 | 163 |
164 UpdateLayerName(name_); | 164 UpdateLayerName(name_); |
165 layer_->SetFillsBoundsOpaquely(!transparent_); | 165 layer_->SetFillsBoundsOpaquely(!transparent_); |
166 // Install new layer as a sibling of the old layer, stacked on top of it. | 166 // Install new layer as a sibling of the old layer, stacked below it. |
167 if (old_layer->parent()) { | 167 if (old_layer->parent()) { |
168 old_layer->parent()->Add(layer_); | 168 old_layer->parent()->Add(layer_); |
169 old_layer->parent()->StackAbove(layer_, old_layer); | 169 old_layer->parent()->StackBelow(layer_, old_layer); |
170 } | 170 } |
171 // Migrate all the child layers over to the new layer. Copy the list because | 171 // Migrate all the child layers over to the new layer. Copy the list because |
172 // the items are removed during iteration. | 172 // the items are removed during iteration. |
173 std::vector<ui::Layer*> children_copy = old_layer->children(); | 173 std::vector<ui::Layer*> children_copy = old_layer->children(); |
174 for (std::vector<ui::Layer*>::const_iterator it = children_copy.begin(); | 174 for (std::vector<ui::Layer*>::const_iterator it = children_copy.begin(); |
175 it != children_copy.end(); | 175 it != children_copy.end(); |
176 ++it) { | 176 ++it) { |
177 ui::Layer* child = *it; | 177 ui::Layer* child = *it; |
178 layer_->Add(child); | 178 layer_->Add(child); |
179 } | 179 } |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 bool contains_mouse = false; | 1100 bool contains_mouse = false; |
1101 if (IsVisible()) { | 1101 if (IsVisible()) { |
1102 RootWindow* root_window = GetRootWindow(); | 1102 RootWindow* root_window = GetRootWindow(); |
1103 contains_mouse = root_window && | 1103 contains_mouse = root_window && |
1104 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); | 1104 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); |
1105 } | 1105 } |
1106 return contains_mouse; | 1106 return contains_mouse; |
1107 } | 1107 } |
1108 | 1108 |
1109 } // namespace aura | 1109 } // namespace aura |
OLD | NEW |