| 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/common/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/common/dock/docked_window_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/wm/common/shelf/wm_shelf.h" | 7 #include "ash/wm/common/shelf/wm_shelf.h" |
| 8 #include "ash/wm/common/shelf/wm_shelf_constants.h" | 8 #include "ash/wm/common/shelf/wm_shelf_constants.h" |
| 9 #include "ash/wm/common/shelf/wm_shelf_observer.h" | 9 #include "ash/wm/common/shelf/wm_shelf_observer.h" |
| 10 #include "ash/wm/common/window_animation_types.h" | 10 #include "ash/wm/common/window_animation_types.h" |
| 11 #include "ash/wm/common/window_parenting_utils.h" | 11 #include "ash/wm/common/window_parenting_utils.h" |
| 12 #include "ash/wm/common/window_resizer.h" | 12 #include "ash/wm/common/window_resizer.h" |
| 13 #include "ash/wm/common/window_state.h" | 13 #include "ash/wm/common/window_state.h" |
| 14 #include "ash/wm/common/wm_globals.h" | 14 #include "ash/wm/common/wm_globals.h" |
| 15 #include "ash/wm/common/wm_lookup.h" |
| 15 #include "ash/wm/common/wm_root_window_controller.h" | 16 #include "ash/wm/common/wm_root_window_controller.h" |
| 16 #include "ash/wm/common/wm_shell_window_ids.h" | 17 #include "ash/wm/common/wm_shell_window_ids.h" |
| 17 #include "ash/wm/common/wm_window.h" | 18 #include "ash/wm/common/wm_window.h" |
| 18 #include "base/auto_reset.h" | 19 #include "base/auto_reset.h" |
| 19 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
| 20 #include "grit/ash_resources.h" | 21 #include "grit/ash_resources.h" |
| 21 #include "third_party/skia/include/core/SkColor.h" | 22 #include "third_party/skia/include/core/SkColor.h" |
| 22 #include "third_party/skia/include/core/SkPaint.h" | 23 #include "third_party/skia/include/core/SkPaint.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/compositor/paint_recorder.h" | 25 #include "ui/compositor/paint_recorder.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 params.type = views::Widget::InitParams::TYPE_POPUP; | 127 params.type = views::Widget::InitParams::TYPE_POPUP; |
| 127 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 128 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 128 params.keep_on_top = false; | 129 params.keep_on_top = false; |
| 129 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 130 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 130 params.accept_events = false; | 131 params.accept_events = false; |
| 131 set_focus_on_creation(false); | 132 set_focus_on_creation(false); |
| 132 parent->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( | 133 parent->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( |
| 133 this, parent->GetShellWindowId(), ¶ms); | 134 this, parent->GetShellWindowId(), ¶ms); |
| 134 Init(params); | 135 Init(params); |
| 135 SetVisibilityChangedAnimationsEnabled(false); | 136 SetVisibilityChangedAnimationsEnabled(false); |
| 136 wm::WmWindow* wm_window = wm::WmWindow::Get(this); | 137 wm::WmWindow* wm_window = wm::WmLookup::Get()->GetWindowForWidget(this); |
| 137 wm_window->SetLockedToRoot(true); | 138 wm_window->SetLockedToRoot(true); |
| 138 opaque_background_.SetColor(SK_ColorBLACK); | 139 opaque_background_.SetColor(SK_ColorBLACK); |
| 139 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size())); | 140 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size())); |
| 140 opaque_background_.SetOpacity(0.0f); | 141 opaque_background_.SetOpacity(0.0f); |
| 141 wm_window->GetLayer()->Add(&opaque_background_); | 142 wm_window->GetLayer()->Add(&opaque_background_); |
| 142 | 143 |
| 143 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 144 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 144 gfx::ImageSkia shelf_background = | 145 gfx::ImageSkia shelf_background = |
| 145 *rb.GetImageSkiaNamed(IDR_ASH_SHELF_BACKGROUND); | 146 *rb.GetImageSkiaNamed(IDR_ASH_SHELF_BACKGROUND); |
| 146 shelf_background_left_ = gfx::ImageSkiaOperations::CreateRotatedImage( | 147 shelf_background_left_ = gfx::ImageSkiaOperations::CreateRotatedImage( |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 | 1320 |
| 1320 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1321 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1321 const gfx::Rect& keyboard_bounds) { | 1322 const gfx::Rect& keyboard_bounds) { |
| 1322 // This bounds change will have caused a change to the Shelf which does not | 1323 // This bounds change will have caused a change to the Shelf which does not |
| 1323 // propagate automatically to this class, so manually recalculate bounds. | 1324 // propagate automatically to this class, so manually recalculate bounds. |
| 1324 Relayout(); | 1325 Relayout(); |
| 1325 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1326 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1326 } | 1327 } |
| 1327 | 1328 |
| 1328 } // namespace ash | 1329 } // namespace ash |
| OLD | NEW |