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

Unified Diff: ash/wm/panels/panel_layout_manager_unittest.cc

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_layout_manager_unittest.cc
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index 9c270b5fef5f6dbd1d2c9001f248b20c4fb97e5b..a8f23cd84a7d76d23bfe61acb42ef22d25c9fe58 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -5,7 +5,6 @@
#include "ash/wm/panels/panel_layout_manager.h"
#include "ash/ash_switches.h"
-#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_button.h"
@@ -119,7 +118,7 @@ class PanelLayoutManagerTest : public test::AshTestBase {
// Waits until all shelf view animations are done.
shelf_view_test()->RunMessageLoopUntilAnimationsDone();
- Shelf* shelf = RootWindowController::ForShelf(panel)->shelf()->shelf();
+ Shelf* shelf = Shelf::ForWindow(panel);
gfx::Rect icon_bounds = shelf->GetScreenBoundsOfItemIconForWindow(panel);
ASSERT_FALSE(icon_bounds.width() == 0 && icon_bounds.height() == 0);
@@ -162,7 +161,7 @@ class PanelLayoutManagerTest : public test::AshTestBase {
base::RunLoop().RunUntilIdle();
views::Widget* widget = GetCalloutWidgetForPanel(panel);
- Shelf* shelf = RootWindowController::ForShelf(panel)->shelf()->shelf();
+ Shelf* shelf = Shelf::ForWindow(panel);
gfx::Rect icon_bounds = shelf->GetScreenBoundsOfItemIconForWindow(panel);
ASSERT_FALSE(icon_bounds.IsEmpty());
@@ -237,21 +236,16 @@ class PanelLayoutManagerTest : public test::AshTestBase {
void SetShelfAutoHideBehavior(aura::Window* window,
ShelfAutoHideBehavior behavior) {
- ShelfLayoutManager* shelf = RootWindowController::ForWindow(window)
- ->shelf()
- ->shelf_layout_manager();
- shelf->SetAutoHideBehavior(behavior);
- ShelfView* shelf_view = GetShelfView(Shelf::ForWindow(window));
- test::ShelfViewTestAPI test_api(shelf_view);
+ Shelf* shelf = Shelf::ForWindow(window);
+ shelf->shelf_layout_manager()->SetAutoHideBehavior(behavior);
+ test::ShelfViewTestAPI test_api(GetShelfView(shelf));
test_api.RunMessageLoopUntilAnimationsDone();
}
void SetShelfVisibilityState(aura::Window* window,
ShelfVisibilityState visibility_state) {
- ShelfLayoutManager* shelf = RootWindowController::ForWindow(window)
- ->shelf()
- ->shelf_layout_manager();
- shelf->SetState(visibility_state);
+ Shelf* shelf = Shelf::ForWindow(window);
+ shelf->shelf_layout_manager()->SetState(visibility_state);
}
ShelfView* GetShelfView(Shelf* shelf) {
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698