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/wm/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_constants.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
11 #include "ash/shelf/shelf_types.h" | 12 #include "ash/shelf/shelf_types.h" |
12 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
14 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
15 #include "ash/wm/coordinate_conversion.h" | 16 #include "ash/wm/coordinate_conversion.h" |
16 #include "ash/wm/window_animations.h" | 17 #include "ash/wm/window_animations.h" |
17 #include "ash/wm/window_properties.h" | 18 #include "ash/wm/window_properties.h" |
18 #include "ash/wm/window_state.h" | 19 #include "ash/wm/window_state.h" |
19 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const int kMinimumHeight = 250; | 53 const int kMinimumHeight = 250; |
53 const int kSlideDurationMs = 120; | 54 const int kSlideDurationMs = 120; |
54 const int kFadeDurationMs = 60; | 55 const int kFadeDurationMs = 60; |
55 const int kMinimizeDurationMs = 720; | 56 const int kMinimizeDurationMs = 720; |
56 | 57 |
57 class DockedBackgroundWidget : public views::Widget, | 58 class DockedBackgroundWidget : public views::Widget, |
58 public internal::BackgroundAnimatorDelegate { | 59 public internal::BackgroundAnimatorDelegate { |
59 public: | 60 public: |
60 explicit DockedBackgroundWidget(aura::Window* container) | 61 explicit DockedBackgroundWidget(aura::Window* container) |
61 : alignment_(DOCKED_ALIGNMENT_NONE), | 62 : alignment_(DOCKED_ALIGNMENT_NONE), |
62 background_animator_(this, 0, kLauncherBackgroundAlpha), | 63 background_animator_(this, 0, kShelfBackgroundAlpha), |
63 alpha_(0), | 64 alpha_(0), |
64 opaque_background_(ui::LAYER_SOLID_COLOR) { | 65 opaque_background_(ui::LAYER_SOLID_COLOR) { |
65 InitWidget(container); | 66 InitWidget(container); |
66 } | 67 } |
67 | 68 |
68 // Sets widget bounds and sizes opaque background layer to fill the widget. | 69 // Sets widget bounds and sizes opaque background layer to fill the widget. |
69 void SetBackgroundBounds(const gfx::Rect bounds, DockedAlignment alignment) { | 70 void SetBackgroundBounds(const gfx::Rect bounds, DockedAlignment alignment) { |
70 SetBounds(bounds); | 71 SetBounds(bounds); |
71 opaque_background_.SetBounds(gfx::Rect(bounds.size())); | 72 opaque_background_.SetBounds(gfx::Rect(bounds.size())); |
72 alignment_ = alignment; | 73 alignment_ = alignment; |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1239 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
1239 const gfx::Rect& keyboard_bounds) { | 1240 const gfx::Rect& keyboard_bounds) { |
1240 // This bounds change will have caused a change to the Shelf which does not | 1241 // This bounds change will have caused a change to the Shelf which does not |
1241 // propagate automatically to this class, so manually recalculate bounds. | 1242 // propagate automatically to this class, so manually recalculate bounds. |
1242 Relayout(); | 1243 Relayout(); |
1243 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1244 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
1244 } | 1245 } |
1245 | 1246 |
1246 } // namespace internal | 1247 } // namespace internal |
1247 } // namespace ash | 1248 } // namespace ash |
OLD | NEW |