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

Unified Diff: ash/shelf/shelf.cc

Issue 2033833002: ash: Remove aura dependencies from ash/system/web_notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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;

Powered by Google App Engine
This is Rietveld 408576698