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/panel_layout_manager.h" | 5 #include "ash/wm/panel_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // TODO(dcheng): Need to anchor to overflow icon. | 267 // TODO(dcheng): Need to anchor to overflow icon. |
268 if (icon_bounds.IsEmpty()) | 268 if (icon_bounds.IsEmpty()) |
269 continue; | 269 continue; |
270 | 270 |
271 if (panel->HasFocus()) { | 271 if (panel->HasFocus()) { |
272 DCHECK(!active_panel); | 272 DCHECK(!active_panel); |
273 active_panel = panel; | 273 active_panel = panel; |
274 } | 274 } |
275 | 275 |
276 gfx::Point icon_origin = icon_bounds.origin(); | 276 gfx::Point icon_origin = icon_bounds.origin(); |
277 aura::Window::ConvertPointToWindow(panel_container_->GetRootWindow(), | 277 aura::Window::ConvertPointToTarget(panel_container_->GetRootWindow(), |
278 panel_container_, &icon_origin); | 278 panel_container_, &icon_origin); |
279 | 279 |
280 // TODO(dcheng): Need to clamp to screen edges. | 280 // TODO(dcheng): Need to clamp to screen edges. |
281 gfx::Rect bounds = panel->bounds(); | 281 gfx::Rect bounds = panel->bounds(); |
282 bounds.set_x( | 282 bounds.set_x( |
283 icon_origin.x() + icon_bounds.width() / 2 - bounds.width() / 2); | 283 icon_origin.x() + icon_bounds.width() / 2 - bounds.width() / 2); |
284 bounds.set_y(launcher_top - bounds.height()); | 284 bounds.set_y(launcher_top - bounds.height()); |
285 SetChildBoundsDirect(panel, bounds); | 285 SetChildBoundsDirect(panel, bounds); |
286 } | 286 } |
287 | 287 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 callout_bounds.set_x( | 358 callout_bounds.set_x( |
359 bounds.x() + (bounds.width() - callout_bounds.width()) / 2); | 359 bounds.x() + (bounds.width() - callout_bounds.width()) / 2); |
360 callout_bounds.set_y(bounds.bottom()); | 360 callout_bounds.set_y(bounds.bottom()); |
361 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds); | 361 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds); |
362 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow()); | 362 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow()); |
363 callout_widget_->Show(); | 363 callout_widget_->Show(); |
364 } | 364 } |
365 | 365 |
366 } // namespace internal | 366 } // namespace internal |
367 } // namespace ash | 367 } // namespace ash |
OLD | NEW |