| 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 status_x.set_x(0); | 924 status_x.set_x(0); |
| 925 status_x.ClampToCenteredSize( | 925 status_x.ClampToCenteredSize( |
| 926 target_bounds->status_bounds_in_shelf.size()); | 926 target_bounds->status_bounds_in_shelf.size()); |
| 927 target_bounds->status_bounds_in_shelf.set_x(status_x.x()); | 927 target_bounds->status_bounds_in_shelf.set_x(status_x.x()); |
| 928 } | 928 } |
| 929 } | 929 } |
| 930 } | 930 } |
| 931 | 931 |
| 932 void ShelfLayoutManager::UpdateShelfBackground( | 932 void ShelfLayoutManager::UpdateShelfBackground( |
| 933 BackgroundAnimator::ChangeType type) { | 933 BackgroundAnimator::ChangeType type) { |
| 934 shelf_->SetPaintsBackground(GetShelfBackgroundType(), type); | 934 const ShelfBackgroundType background_type(GetShelfBackgroundType()); |
| 935 shelf_->SetPaintsBackground(background_type, type); |
| 936 FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, |
| 937 OnBackgroundUpdated(background_type, type)); |
| 935 } | 938 } |
| 936 | 939 |
| 937 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { | 940 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { |
| 938 if (state_.visibility_state != SHELF_AUTO_HIDE && | 941 if (state_.visibility_state != SHELF_AUTO_HIDE && |
| 939 state_.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED) { | 942 state_.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED) { |
| 940 return SHELF_BACKGROUND_MAXIMIZED; | 943 return SHELF_BACKGROUND_MAXIMIZED; |
| 941 } | 944 } |
| 942 | 945 |
| 943 if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS || | 946 if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS || |
| 944 (!state_.is_screen_locked && window_overlaps_shelf_) || | 947 (!state_.is_screen_locked && window_overlaps_shelf_) || |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 return gfx::Insets(0, distance, 0, 0); | 1161 return gfx::Insets(0, distance, 0, 0); |
| 1159 case SHELF_ALIGNMENT_TOP: | 1162 case SHELF_ALIGNMENT_TOP: |
| 1160 return gfx::Insets(0, 0, distance, 0); | 1163 return gfx::Insets(0, 0, distance, 0); |
| 1161 } | 1164 } |
| 1162 NOTREACHED(); | 1165 NOTREACHED(); |
| 1163 return gfx::Insets(); | 1166 return gfx::Insets(); |
| 1164 } | 1167 } |
| 1165 | 1168 |
| 1166 } // namespace internal | 1169 } // namespace internal |
| 1167 } // namespace ash | 1170 } // namespace ash |
| OLD | NEW |