Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1509)

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2228713003: mash: Convert ShelfView to wm common types, clean up Shelf access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix control reaches end of non-void function warnings Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_icon_observer.h ('k') | ash/shelf/shelf_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/accelerators/accelerator_controller.h" 8 #include "ash/common/accelerators/accelerator_controller.h"
9 #include "ash/common/accelerators/accelerator_table.h" 9 #include "ash/common/accelerators/accelerator_table.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
11 #include "ash/common/focus_cycler.h" 11 #include "ash/common/focus_cycler.h"
12 #include "ash/common/material_design/material_design_controller.h" 12 #include "ash/common/material_design/material_design_controller.h"
13 #include "ash/common/session/session_state_delegate.h" 13 #include "ash/common/session/session_state_delegate.h"
14 #include "ash/common/shelf/shelf_constants.h" 14 #include "ash/common/shelf/shelf_constants.h"
15 #include "ash/common/shelf/shelf_view.h"
15 #include "ash/common/shell_window_ids.h" 16 #include "ash/common/shell_window_ids.h"
16 #include "ash/common/system/status_area_widget.h" 17 #include "ash/common/system/status_area_widget.h"
17 #include "ash/common/system/tray/system_tray.h" 18 #include "ash/common/system/tray/system_tray.h"
18 #include "ash/common/system/tray/system_tray_item.h" 19 #include "ash/common/system/tray/system_tray_item.h"
19 #include "ash/common/wm/window_state.h" 20 #include "ash/common/wm/window_state.h"
20 #include "ash/common/wm_shell.h" 21 #include "ash/common/wm_shell.h"
21 #include "ash/display/display_manager.h" 22 #include "ash/display/display_manager.h"
22 #include "ash/root_window_controller.h" 23 #include "ash/root_window_controller.h"
23 #include "ash/shelf/shelf.h" 24 #include "ash/shelf/shelf.h"
24 #include "ash/shelf/shelf_layout_manager_observer.h" 25 #include "ash/shelf/shelf_layout_manager_observer.h"
25 #include "ash/shelf/shelf_view.h"
26 #include "ash/shelf/shelf_widget.h" 26 #include "ash/shelf/shelf_widget.h"
27 #include "ash/shell.h" 27 #include "ash/shell.h"
28 #include "ash/test/ash_test_base.h" 28 #include "ash/test/ash_test_base.h"
29 #include "ash/test/display_manager_test_api.h" 29 #include "ash/test/display_manager_test_api.h"
30 #include "ash/test/shelf_test_api.h" 30 #include "ash/test/shelf_test_api.h"
31 #include "ash/test/test_system_tray_item.h" 31 #include "ash/test/test_system_tray_item.h"
32 #include "ash/wm/window_state_aura.h" 32 #include "ash/wm/window_state_aura.h"
33 #include "ash/wm/window_util.h" 33 #include "ash/wm/window_util.h"
34 #include "base/command_line.h" 34 #include "base/command_line.h"
35 #include "ui/aura/client/aura_constants.h" 35 #include "ui/aura/client/aura_constants.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // non-MD. 183 // non-MD.
184 if (!ash::MaterialDesignController::IsShelfMaterial() || 184 if (!ash::MaterialDesignController::IsShelfMaterial() ||
185 GetShelf()->GetAutoHideState() != ash::SHELF_AUTO_HIDE_HIDDEN) { 185 GetShelf()->GetAutoHideState() != ash::SHELF_AUTO_HIDE_HIDDEN) {
186 EXPECT_GE(shelf_bounds.height(), 186 EXPECT_GE(shelf_bounds.height(),
187 auto_hidden_shelf_widget_bounds_.height()); 187 auto_hidden_shelf_widget_bounds_.height());
188 } 188 }
189 189
190 float scroll_delta = 190 float scroll_delta =
191 GetShelfLayoutManager()->PrimaryAxisValue(scroll_.y(), scroll_.x()); 191 GetShelfLayoutManager()->PrimaryAxisValue(scroll_.y(), scroll_.x());
192 bool increasing_drag = 192 bool increasing_drag =
193 GetShelfWidget()->shelf()->SelectValueForShelfAlignment( 193 GetShelfLayoutManager()->SelectValueForShelfAlignment(
194 scroll_delta<0, scroll_delta> 0, scroll_delta < 0); 194 scroll_delta<0, scroll_delta> 0, scroll_delta < 0);
195 int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue( 195 int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue(
196 shelf_bounds.height(), shelf_bounds.width()); 196 shelf_bounds.height(), shelf_bounds.width());
197 int visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( 197 int visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue(
198 shelf_widget_bounds_.height(), shelf_widget_bounds_.width()); 198 shelf_widget_bounds_.height(), shelf_widget_bounds_.width());
199 int not_visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue( 199 int not_visible_bounds_size = GetShelfLayoutManager()->PrimaryAxisValue(
200 auto_hidden_shelf_widget_bounds_.height(), 200 auto_hidden_shelf_widget_bounds_.height(),
201 auto_hidden_shelf_widget_bounds_.width()); 201 auto_hidden_shelf_widget_bounds_.width());
202 if (was_visible_on_drag_start_) { 202 if (was_visible_on_drag_start_) {
203 if (increasing_drag) { 203 if (increasing_drag) {
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 1930
1931 StatusAreaWidget* status_area_widget = GetShelfWidget()->status_area_widget(); 1931 StatusAreaWidget* status_area_widget = GetShelfWidget()->status_area_widget();
1932 EXPECT_TRUE(status_area_widget->IsVisible()); 1932 EXPECT_TRUE(status_area_widget->IsVisible());
1933 // Shelf should be in the first display's area. 1933 // Shelf should be in the first display's area.
1934 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); 1934 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen());
1935 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); 1935 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds));
1936 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); 1936 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right());
1937 } 1937 }
1938 1938
1939 } // namespace ash 1939 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_icon_observer.h ('k') | ash/shelf/shelf_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698