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

Unified Diff: ash/system/web_notification/ash_popup_alignment_delegate.cc

Issue 2029323002: mash: Convert AshPopupAlignmentDelegate to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 6 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/system/web_notification/ash_popup_alignment_delegate.cc
diff --git a/ash/system/web_notification/ash_popup_alignment_delegate.cc b/ash/system/web_notification/ash_popup_alignment_delegate.cc
index 22475f2175f61b944a55536d1d32d82cabc9999b..82444a989703cb9d447556215256ba86a230c41a 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate.cc
@@ -6,12 +6,9 @@
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/shelf_types.h"
-#include "ash/common/wm_lookup.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
-#include "ash/display/window_tree_host_manager.h"
-#include "ash/shelf/shelf_layout_manager.h"
-#include "ash/shelf/shelf_widget.h"
#include "base/i18n/rtl.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
@@ -30,9 +27,9 @@ const int kToastMarginX = 3;
// shadow).
const int kNoToastMarginBorderAndShadowOffset = 2;
-}
+} // namespace
-AshPopupAlignmentDelegate::AshPopupAlignmentDelegate(ShelfLayoutManager* shelf)
+AshPopupAlignmentDelegate::AshPopupAlignmentDelegate(WmShelf* shelf)
: screen_(NULL), shelf_(shelf), system_tray_height_(0) {
shelf_->AddObserver(this);
}
@@ -60,8 +57,8 @@ void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) {
// If the shelf is shown during auto-hide state, the distance from the edge
// should be reduced by the height of shelf's shown height.
- if (shelf_->visibility_state() == SHELF_AUTO_HIDE &&
- shelf_->auto_hide_state() == SHELF_AUTO_HIDE_SHOWN) {
+ if (shelf_->GetVisibilityState() == SHELF_AUTO_HIDE &&
+ shelf_->GetAutoHideState() == SHELF_AUTO_HIDE_SHOWN) {
system_tray_height_ -= GetShelfConstant(SHELF_SIZE) - kShelfAutoHideSize;
}
@@ -112,20 +109,24 @@ ShelfAlignment AshPopupAlignmentDelegate::GetAlignment() const {
}
display::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const {
- return WmLookup::Get()
- ->GetWindowForWidget(shelf_->shelf_widget())
- ->GetDisplayNearestWindow();
+ return shelf_->GetWindow()->GetDisplayNearestWindow();
}
void AshPopupAlignmentDelegate::UpdateWorkArea() {
- work_area_ = shelf_->user_work_area_bounds();
+ work_area_ = shelf_->GetUserWorkAreaBounds();
DoUpdateIfPossible();
}
+///////////////////////////////////////////////////////////////////////////////
+// ShellObserver:
+
void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() {
UpdateWorkArea();
}
+///////////////////////////////////////////////////////////////////////////////
+// WmShelfObserver:
+
void AshPopupAlignmentDelegate::WillChangeVisibilityState(
ShelfVisibilityState new_state) {
UpdateWorkArea();
@@ -136,6 +137,9 @@ void AshPopupAlignmentDelegate::OnAutoHideStateChanged(
UpdateWorkArea();
}
+///////////////////////////////////////////////////////////////////////////////
+// display::DisplayObserver:
+
void AshPopupAlignmentDelegate::OnDisplayAdded(
const display::Display& new_display) {}

Powered by Google App Engine
This is Rietveld 408576698