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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 2878133002: mash: Serialize ShelfIDs for property conversion and transport. (Closed)
Patch Set: Address comments. Created 3 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
« no previous file with comments | « ash/shelf/shelf_model.h ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index ded98373f428f414c434283d811199ebc894c013..b5be4a4c1e6fb14894e86607009fa617573dee10 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -297,24 +297,26 @@ void ShelfWidget::Shutdown() {
}
void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
- ShelfID* id = panel->aura_window()->GetProperty(kShelfIDKey);
- if (!shelf_view_ || !id)
+ ShelfID id =
+ ShelfID::Deserialize(panel->aura_window()->GetProperty(kShelfIDKey));
+ if (!shelf_view_ || id.IsNull())
return;
WmWindow* shelf_window = WmWindow::Get(this->GetNativeWindow());
shelf_view_->UpdatePanelIconPosition(
- *id, shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen())
- .CenterPoint());
+ id, shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen())
+ .CenterPoint());
}
gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
- ShelfID* id = window->aura_window()->GetProperty(kShelfIDKey);
+ ShelfID id =
+ ShelfID::Deserialize(window->aura_window()->GetProperty(kShelfIDKey));
// Window animations can be triggered during session restore before the shelf
// view is created. In that case, return default empty bounds.
- if (!shelf_view_ || !id)
+ if (!shelf_view_ || id.IsNull())
return gfx::Rect();
- gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(*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(),
« no previous file with comments | « ash/shelf/shelf_model.h ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698