| 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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // this can be simplified. | 757 // this can be simplified. |
| 758 gfx::Rect status_bounds = target_bounds.status_bounds_in_shelf; | 758 gfx::Rect status_bounds = target_bounds.status_bounds_in_shelf; |
| 759 status_bounds.Offset(target_bounds.shelf_bounds_in_root.OffsetFromOrigin()); | 759 status_bounds.Offset(target_bounds.shelf_bounds_in_root.OffsetFromOrigin()); |
| 760 // mash::wm::ShelfLayout manages window bounds when running mash. | 760 // mash::wm::ShelfLayout manages window bounds when running mash. |
| 761 if (!Shell::GetInstance()->in_mus()) { | 761 if (!Shell::GetInstance()->in_mus()) { |
| 762 shelf_widget_->status_area_widget()->SetBounds( | 762 shelf_widget_->status_area_widget()->SetBounds( |
| 763 ScreenUtil::ConvertRectToScreen( | 763 ScreenUtil::ConvertRectToScreen( |
| 764 shelf_widget_->status_area_widget()->GetNativeView()->parent(), | 764 shelf_widget_->status_area_widget()->GetNativeView()->parent(), |
| 765 status_bounds)); | 765 status_bounds)); |
| 766 } | 766 } |
| 767 // For crbug.com/622431, when the shelf alignment is BOTTOM_LOCKED, we | |
| 768 // don't set display work area, as it is not real user-set alignment. | |
| 769 if (!state_.is_screen_locked && | 767 if (!state_.is_screen_locked && |
| 768 !WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked() && |
| 770 shelf_widget_->GetAlignment() != SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 769 shelf_widget_->GetAlignment() != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 771 gfx::Insets insets; | 770 gfx::Insets insets; |
| 772 // If user session is blocked (login to new user session or add user to | 771 // If user session is blocked (login to new user session or add user to |
| 773 // the existing session - multi-profile) then give 100% of work area only | 772 // the existing session - multi-profile) then give 100% of work area only |
| 774 // if keyboard is not shown. | 773 // if keyboard is not shown. |
| 775 if (!state_.is_adding_user_screen || !keyboard_bounds_.IsEmpty()) | 774 if (!state_.is_adding_user_screen || !keyboard_bounds_.IsEmpty()) |
| 776 insets = target_bounds.work_area_insets; | 775 insets = target_bounds.work_area_insets; |
| 777 Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, insets); | 776 Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, insets); |
| 778 } | 777 } |
| 779 } | 778 } |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 if (ash::MaterialDesignController::IsShelfMaterial()) { | 1206 if (ash::MaterialDesignController::IsShelfMaterial()) { |
| 1208 return (state.visibility_state == SHELF_AUTO_HIDE && | 1207 return (state.visibility_state == SHELF_AUTO_HIDE && |
| 1209 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) | 1208 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) |
| 1210 ? 1.0f | 1209 ? 1.0f |
| 1211 : 0.0f; | 1210 : 0.0f; |
| 1212 } | 1211 } |
| 1213 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; | 1212 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; |
| 1214 } | 1213 } |
| 1215 | 1214 |
| 1216 } // namespace ash | 1215 } // namespace ash |
| OLD | NEW |