| 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 "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (GetShelfWidget()->GetDimsShelf()) | 173 if (GetShelfWidget()->GetDimsShelf()) |
| 174 EXPECT_EQ(GetShelfWidget()->GetWindowBoundsInScreen(), | 174 EXPECT_EQ(GetShelfWidget()->GetWindowBoundsInScreen(), |
| 175 GetShelfWidget()->GetDimmerBoundsForTest()); | 175 GetShelfWidget()->GetDimmerBoundsForTest()); |
| 176 | 176 |
| 177 // The shelf should never be smaller than the hidden state. | 177 // The shelf should never be smaller than the hidden state. |
| 178 EXPECT_GE(shelf_bounds.height(), not_visible_bounds_.height()); | 178 EXPECT_GE(shelf_bounds.height(), not_visible_bounds_.height()); |
| 179 float scroll_delta = GetShelfLayoutManager()->PrimaryAxisValue( | 179 float scroll_delta = GetShelfLayoutManager()->PrimaryAxisValue( |
| 180 scroll_.y(), | 180 scroll_.y(), |
| 181 scroll_.x()); | 181 scroll_.x()); |
| 182 bool increasing_drag = | 182 bool increasing_drag = |
| 183 GetShelfLayoutManager()->SelectValueForShelfAlignment( | 183 GetShelfWidget()->shelf()->SelectValueForShelfAlignment( |
| 184 scroll_delta < 0, | 184 scroll_delta < 0, scroll_delta > 0, |
| 185 scroll_delta > 0, | 185 scroll_delta < 0, scroll_delta > 0); |
| 186 scroll_delta < 0, | |
| 187 scroll_delta > 0); | |
| 188 int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue( | 186 int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue( |
| 189 shelf_bounds.height(), | 187 shelf_bounds.height(), |
| 190 shelf_bounds.width()); | 188 shelf_bounds.width()); |
| 191 int visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( | 189 int visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( |
| 192 visible_bounds_.height(), | 190 visible_bounds_.height(), |
| 193 visible_bounds_.width()); | 191 visible_bounds_.width()); |
| 194 int not_visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( | 192 int not_visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( |
| 195 not_visible_bounds_.height(), | 193 not_visible_bounds_.height(), |
| 196 not_visible_bounds_.width()); | 194 not_visible_bounds_.width()); |
| 197 if (was_visible_on_drag_start_) { | 195 if (was_visible_on_drag_start_) { |
| (...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2367 StatusAreaWidget* status_area_widget = | 2365 StatusAreaWidget* status_area_widget = |
| 2368 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); | 2366 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); |
| 2369 EXPECT_TRUE(status_area_widget->IsVisible()); | 2367 EXPECT_TRUE(status_area_widget->IsVisible()); |
| 2370 // Shelf should be in the first display's area. | 2368 // Shelf should be in the first display's area. |
| 2371 // TODO: make this test more robust against changes in font, font size. | 2369 // TODO: make this test more robust against changes in font, font size. |
| 2372 EXPECT_EQ("353,453 147x47", | 2370 EXPECT_EQ("353,453 147x47", |
| 2373 status_area_widget->GetWindowBoundsInScreen().ToString()); | 2371 status_area_widget->GetWindowBoundsInScreen().ToString()); |
| 2374 } | 2372 } |
| 2375 | 2373 |
| 2376 } // namespace ash | 2374 } // namespace ash |
| OLD | NEW |