| Index: ash/shelf/shelf.cc
|
| diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
|
| index 9009532e78731200b901ae9bf77dd81e0a4e41dd..35bf021510c1a509300d30777b2fb27669aab40b 100644
|
| --- a/ash/shelf/shelf.cc
|
| +++ b/ash/shelf/shelf.cc
|
| @@ -11,6 +11,7 @@
|
| #include "ash/common/wm/shelf/wm_shelf_util.h"
|
| #include "ash/focus_cycler.h"
|
| #include "ash/root_window_controller.h"
|
| +#include "ash/root_window_settings.h"
|
| #include "ash/screen_util.h"
|
| #include "ash/shelf/shelf_delegate.h"
|
| #include "ash/shelf/shelf_item_delegate.h"
|
| @@ -72,6 +73,18 @@ Shelf* Shelf::ForWindow(const aura::Window* window) {
|
| return shelf_widget ? shelf_widget->shelf() : nullptr;
|
| }
|
|
|
| +// static
|
| +Shelf* Shelf::ForDisplayId(int64_t display_id) {
|
| + for (aura::Window* window : Shell::GetInstance()->GetAllRootWindows()) {
|
| + RootWindowSettings* settings = GetRootWindowSettings(window);
|
| + if (settings->display_id == display_id && settings->controller) {
|
| + ShelfWidget* shelf_widget = settings->controller->shelf_widget();
|
| + return shelf_widget ? shelf_widget->shelf() : nullptr;
|
| + }
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| void Shelf::SetAlignment(wm::ShelfAlignment alignment) {
|
| if (alignment_ == alignment)
|
| return;
|
|
|