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 "ash/wm/drag_window_controller.h" | 5 #include "ash/wm/drag_window_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 if (details->layer_owner_) { | 227 if (details->layer_owner_) { |
228 if (index == 0) | 228 if (index == 0) |
229 return details->layer_owner_.get(); | 229 return details->layer_owner_.get(); |
230 index--; | 230 index--; |
231 } | 231 } |
232 } | 232 } |
233 return nullptr; | 233 return nullptr; |
234 } | 234 } |
235 | 235 |
236 void DragWindowController::RequestLayerPaintForTest() { | 236 void DragWindowController::RequestLayerPaintForTest() { |
237 ui::PaintContext context(nullptr, 1.0f, gfx::Rect()); | 237 ui::PaintContext context(nullptr, 1.0f, gfx::Rect(), gfx::Size()); |
238 for (auto& details : drag_windows_) { | 238 for (auto& details : drag_windows_) { |
239 std::vector<ui::Layer*> layers; | 239 std::vector<ui::Layer*> layers; |
240 layers.push_back(details->drag_window_->layer()); | 240 layers.push_back(details->drag_window_->layer()); |
241 while (layers.size()) { | 241 while (layers.size()) { |
242 ui::Layer* layer = layers.back(); | 242 ui::Layer* layer = layers.back(); |
243 layers.pop_back(); | 243 layers.pop_back(); |
244 if (layer->delegate()) | 244 if (layer->delegate()) |
245 layer->delegate()->OnPaintLayer(context); | 245 layer->delegate()->OnPaintLayer(context); |
246 for (auto* child : layer->children()) | 246 for (auto* child : layer->children()) |
247 layers.push_back(child); | 247 layers.push_back(child); |
248 } | 248 } |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 } // namespace ash | 252 } // namespace ash |
OLD | NEW |