OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/common/wm/dock/docked_window_layout_manager.h" | 5 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
6 | 6 |
7 #include "ash/animation/animation_change_type.h" | 7 #include "ash/animation/animation_change_type.h" |
8 #include "ash/common/shelf/shelf_background_animator.h" | 8 #include "ash/common/shelf/shelf_background_animator.h" |
9 #include "ash/common/shelf/shelf_background_animator_observer.h" | 9 #include "ash/common/shelf/shelf_background_animator_observer.h" |
10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
12 #include "ash/common/shelf/wm_shelf_observer.h" | 12 #include "ash/common/shelf/wm_shelf_observer.h" |
13 #include "ash/common/wm/overview/window_selector_controller.h" | 13 #include "ash/common/wm/overview/window_selector_controller.h" |
14 #include "ash/common/wm/window_animation_types.h" | 14 #include "ash/common/wm/window_animation_types.h" |
15 #include "ash/common/wm/window_parenting_utils.h" | 15 #include "ash/common/wm/window_parenting_utils.h" |
16 #include "ash/common/wm/window_resizer.h" | 16 #include "ash/common/wm/window_resizer.h" |
17 #include "ash/common/wm/window_state.h" | 17 #include "ash/common/wm/window_state.h" |
18 #include "ash/common/wm_lookup.h" | 18 #include "ash/common/wm_lookup.h" |
19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
20 #include "ash/common/wm_window.h" | 20 #include "ash/common/wm_window.h" |
21 #include "ash/public/cpp/shell_window_ids.h" | 21 #include "ash/public/cpp/shell_window_ids.h" |
22 #include "ash/resources/grit/ash_resources.h" | 22 #include "ash/resources/grit/ash_resources.h" |
23 #include "ash/root_window_controller.h" | 23 #include "ash/root_window_controller.h" |
24 #include "ash/screen_util.h" | |
25 #include "ash/wm/window_state_aura.h" | 24 #include "ash/wm/window_state_aura.h" |
26 #include "base/auto_reset.h" | 25 #include "base/auto_reset.h" |
27 #include "base/metrics/histogram_macros.h" | 26 #include "base/metrics/histogram_macros.h" |
28 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
29 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
30 #include "ui/compositor/scoped_layer_animation_settings.h" | 29 #include "ui/compositor/scoped_layer_animation_settings.h" |
31 #include "ui/display/display.h" | 30 #include "ui/display/display.h" |
32 #include "ui/display/screen.h" | 31 #include "ui/display/screen.h" |
33 #include "ui/views/background.h" | 32 #include "ui/views/background.h" |
| 33 #include "ui/wm/core/coordinate_conversion.h" |
34 #include "ui/wm/core/window_animations.h" | 34 #include "ui/wm/core/window_animations.h" |
35 | 35 |
36 namespace ash { | 36 namespace ash { |
37 | 37 |
38 // Minimum, maximum width of the dock area and a width of the gap | 38 // Minimum, maximum width of the dock area and a width of the gap |
39 // static | 39 // static |
40 const int DockedWindowLayoutManager::kMaxDockWidth = 360; | 40 const int DockedWindowLayoutManager::kMaxDockWidth = 360; |
41 // static | 41 // static |
42 const int DockedWindowLayoutManager::kMinDockWidth = 200; | 42 const int DockedWindowLayoutManager::kMinDockWidth = 200; |
43 // static | 43 // static |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 ->GetWindow() | 326 ->GetWindow() |
327 ->aura_window() | 327 ->aura_window() |
328 ->RemoveObserver(this); | 328 ->RemoveObserver(this); |
329 } | 329 } |
330 } | 330 } |
331 | 331 |
332 // aura::WindowObserver: | 332 // aura::WindowObserver: |
333 void OnWindowBoundsChanged(aura::Window* window, | 333 void OnWindowBoundsChanged(aura::Window* window, |
334 const gfx::Rect& old_bounds, | 334 const gfx::Rect& old_bounds, |
335 const gfx::Rect& new_bounds) override { | 335 const gfx::Rect& new_bounds) override { |
336 shelf_bounds_in_screen_ = | 336 shelf_bounds_in_screen_ = new_bounds; |
337 ScreenUtil::ConvertRectToScreen(window->parent(), new_bounds); | 337 ::wm::ConvertRectToScreen(window->parent(), &shelf_bounds_in_screen_); |
338 | 338 |
339 // When the shelf is auto-hidden, it has an invisible height of 3px used | 339 // When the shelf is auto-hidden, it has an invisible height of 3px used |
340 // as a hit region which is specific to Chrome OS MD (for non-MD, the 3 | 340 // as a hit region which is specific to Chrome OS MD (for non-MD, the 3 |
341 // pixels are visible). In computing the work area we should consider a | 341 // pixels are visible). In computing the work area we should consider a |
342 // hidden shelf as having a height of 0 (for non-MD, shelf height is 3). | 342 // hidden shelf as having a height of 0 (for non-MD, shelf height is 3). |
343 if (docked_layout_manager_->shelf()->GetAutoHideState() == | 343 if (docked_layout_manager_->shelf()->GetAutoHideState() == |
344 ShelfAutoHideState::SHELF_AUTO_HIDE_HIDDEN) { | 344 ShelfAutoHideState::SHELF_AUTO_HIDE_HIDDEN) { |
345 shelf_bounds_in_screen_.set_height( | 345 shelf_bounds_in_screen_.set_height( |
346 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE)); | 346 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE)); |
347 } | 347 } |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 const gfx::Rect& keyboard_bounds) { | 1327 const gfx::Rect& keyboard_bounds) { |
1328 // This bounds change will have caused a change to the Shelf which does not | 1328 // This bounds change will have caused a change to the Shelf which does not |
1329 // propagate automatically to this class, so manually recalculate bounds. | 1329 // propagate automatically to this class, so manually recalculate bounds. |
1330 Relayout(); | 1330 Relayout(); |
1331 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1331 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
1332 } | 1332 } |
1333 | 1333 |
1334 void DockedWindowLayoutManager::OnKeyboardClosed() {} | 1334 void DockedWindowLayoutManager::OnKeyboardClosed() {} |
1335 | 1335 |
1336 } // namespace ash | 1336 } // namespace ash |
OLD | NEW |