| 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/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.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" |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 int dock_inset = docked_width + (docked_width > 0 ? kMinDockGap : 0); | 1290 int dock_inset = docked_width + (docked_width > 0 ? kMinDockGap : 0); |
| 1291 const gfx::Rect work_area = | 1291 const gfx::Rect work_area = |
| 1292 dock_container_->GetDisplayNearestWindow().work_area(); | 1292 dock_container_->GetDisplayNearestWindow().work_area(); |
| 1293 gfx::Rect bounds = gfx::Rect( | 1293 gfx::Rect bounds = gfx::Rect( |
| 1294 alignment_ == DOCKED_ALIGNMENT_RIGHT && dock_inset > 0 | 1294 alignment_ == DOCKED_ALIGNMENT_RIGHT && dock_inset > 0 |
| 1295 ? dock_container_->GetBounds().right() - dock_inset | 1295 ? dock_container_->GetBounds().right() - dock_inset |
| 1296 : dock_container_->GetBounds().x(), | 1296 : dock_container_->GetBounds().x(), |
| 1297 dock_container_->GetBounds().y(), dock_inset, work_area.height()); | 1297 dock_container_->GetBounds().y(), dock_inset, work_area.height()); |
| 1298 docked_bounds_ = | 1298 docked_bounds_ = |
| 1299 bounds + dock_container_->GetBoundsInScreen().OffsetFromOrigin(); | 1299 bounds + dock_container_->GetBoundsInScreen().OffsetFromOrigin(); |
| 1300 FOR_EACH_OBSERVER(DockedWindowLayoutManagerObserver, observer_list_, | 1300 for (auto& observer : observer_list_) |
| 1301 OnDockBoundsChanging(bounds, reason)); | 1301 observer.OnDockBoundsChanging(bounds, reason); |
| 1302 // Show or hide background for docked area. | 1302 // Show or hide background for docked area. |
| 1303 gfx::Rect background_bounds(docked_bounds_); | 1303 gfx::Rect background_bounds(docked_bounds_); |
| 1304 if (shelf_observer_) | 1304 if (shelf_observer_) |
| 1305 background_bounds.Subtract(shelf_observer_->shelf_bounds_in_screen()); | 1305 background_bounds.Subtract(shelf_observer_->shelf_bounds_in_screen()); |
| 1306 if (docked_width > 0) { | 1306 if (docked_width > 0) { |
| 1307 // TODO: |shelf_| should not be null by the time we get here, but it may | 1307 // TODO: |shelf_| should not be null by the time we get here, but it may |
| 1308 // be in mash as startup sequence doesn't yet match that of ash. Once | 1308 // be in mash as startup sequence doesn't yet match that of ash. Once |
| 1309 // |shelf_| is created at same time as ash we can remove conditional. | 1309 // |shelf_| is created at same time as ash we can remove conditional. |
| 1310 // http://crbug.com/632099 | 1310 // http://crbug.com/632099 |
| 1311 if (shelf_) { | 1311 if (shelf_) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 const gfx::Rect& keyboard_bounds) { | 1378 const gfx::Rect& keyboard_bounds) { |
| 1379 // This bounds change will have caused a change to the Shelf which does not | 1379 // This bounds change will have caused a change to the Shelf which does not |
| 1380 // propagate automatically to this class, so manually recalculate bounds. | 1380 // propagate automatically to this class, so manually recalculate bounds. |
| 1381 Relayout(); | 1381 Relayout(); |
| 1382 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1382 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 void DockedWindowLayoutManager::OnKeyboardClosed() {} | 1385 void DockedWindowLayoutManager::OnKeyboardClosed() {} |
| 1386 | 1386 |
| 1387 } // namespace ash | 1387 } // namespace ash |
| OLD | NEW |