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

Unified Diff: ash/common/shelf/shelf_widget.cc

Issue 2274333002: ash: Move more code from Shelf to WmShelf (Closed)
Patch Set: review comments Created 4 years, 4 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/common/shelf/shelf_widget.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_widget.cc
diff --git a/ash/common/shelf/shelf_widget.cc b/ash/common/shelf/shelf_widget.cc
index e4d0d02335850fc710d30cda5685091e3c25d025..d1f5c72aef3c44b605630a40901fe66578a96455 100644
--- a/ash/common/shelf/shelf_widget.cc
+++ b/ash/common/shelf/shelf_widget.cc
@@ -18,9 +18,11 @@
#include "ash/common/system/status_area_layout_manager.h"
#include "ash/common/system/status_area_widget.h"
#include "ash/common/system/tray/system_tray_delegate.h"
+#include "ash/common/wm_lookup.h"
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/common/wm_window_property.h"
#include "base/memory/ptr_util.h"
#include "grit/ash_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -501,6 +503,24 @@ void ShelfWidget::ForceUndimming(bool force) {
delegate_view_->ForceUndimming(force);
}
+void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
+ WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this);
+ shelf_view_->UpdatePanelIconPosition(
+ panel->GetIntProperty(WmWindowProperty::SHELF_ID),
+ shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen())
+ .CenterPoint());
+}
+
+gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
+ ShelfID id = window->GetIntProperty(WmWindowProperty::SHELF_ID);
+ gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id));
+ gfx::Point screen_origin;
+ views::View::ConvertPointToScreen(shelf_view_, &screen_origin);
+ return gfx::Rect(screen_origin.x() + bounds.x(),
+ screen_origin.y() + bounds.y(), bounds.width(),
+ bounds.height());
+}
+
void ShelfWidget::OnWidgetActivationChanged(views::Widget* widget,
bool active) {
activating_as_fallback_ = false;
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698