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

Unified Diff: ash/wm/workspace/workspace_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/window_animations.cc ('k') | chrome/browser/chromeos/accessibility/accessibility_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index d2bc5da1d81a3d11d70bf767a9fe4fd57a0f392a..918b2fd0a6c38216d7c9a565b75ce11cf70db465 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -12,6 +12,7 @@
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/session/session_state_delegate.h"
+#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ash/shell_observer.h"
@@ -315,8 +316,8 @@ class DontClobberRestoreBoundsWindowObserver : public aura::WindowObserver {
aura::Window* w = window_;
window_ = nullptr;
- gfx::Rect shelf_bounds(Shell::GetPrimaryRootWindowController()->
- GetShelfLayoutManager()->GetIdealBounds());
+ gfx::Rect shelf_bounds(
+ Shelf::ForPrimaryDisplay()->shelf_layout_manager()->GetIdealBounds());
const gfx::Rect& window_bounds(w->bounds());
w->SetBounds(gfx::Rect(window_bounds.x(), shelf_bounds.y() - 1,
window_bounds.width(), window_bounds.height()));
@@ -792,8 +793,9 @@ TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) {
window->SetProperty(aura::client::kAlwaysOnTopKey, true);
window->Show();
- ShelfLayoutManager* shelf = ShelfLayoutManager::ForShelf(window.get());
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ ShelfLayoutManager* shelf_layout_manager =
+ Shelf::ForWindow(window.get())->shelf_layout_manager();
+ shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()));
gfx::Rect window_bounds = window->bounds();
@@ -803,12 +805,12 @@ TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) {
// The window size should not get touched while we are in lock screen.
Shell::GetInstance()->session_state_delegate()->LockScreen();
- shelf->UpdateVisibilityState();
+ shelf_layout_manager->UpdateVisibilityState();
EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString());
// Coming out of the lock screen the window size should still remain.
Shell::GetInstance()->session_state_delegate()->UnlockScreen();
- shelf->UpdateVisibilityState();
+ shelf_layout_manager->UpdateVisibilityState();
EXPECT_EQ(
ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(),
window_bounds.ToString());
@@ -984,7 +986,7 @@ TEST_F(WorkspaceLayoutManagerBackdropTest, VerifyBackdropAndItsStacking) {
// entire workspace area.
TEST_F(WorkspaceLayoutManagerBackdropTest, ShelfVisibilityChangesBounds) {
ShelfLayoutManager* shelf_layout_manager =
- Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
+ Shelf::ForPrimaryDisplay()->shelf_layout_manager();
ShowTopWindowBackdrop(true);
RunAllPendingInMessageLoop();
« no previous file with comments | « ash/wm/window_animations.cc ('k') | chrome/browser/chromeos/accessibility/accessibility_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698