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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. 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_view_unittest.cc ('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 7afc20228e57df15913451e365d07326647ff952..abc20e1aa471e1c5cfa8d8af42e1138c930e10ea 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -6,6 +6,7 @@
#include "ash/animation/animation_change_type.h"
#include "ash/focus_cycler.h"
+#include "ash/public/cpp/window_properties.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller.h"
#include "ash/shelf/app_list_button.h"
@@ -17,7 +18,6 @@
#include "ash/shell.h"
#include "ash/system/status_area_layout_manager.h"
#include "ash/system/status_area_widget.h"
-#include "ash/wm/window_properties.h"
#include "ash/wm_window.h"
#include "base/memory/ptr_util.h"
#include "ui/compositor/layer.h"
@@ -299,24 +299,24 @@ void ShelfWidget::Shutdown() {
}
void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
- if (!shelf_view_)
+ ShelfID* id = panel->aura_window()->GetProperty(kShelfIDKey);
+ if (!shelf_view_ || !id)
return;
WmWindow* shelf_window = WmWindow::Get(this->GetNativeWindow());
shelf_view_->UpdatePanelIconPosition(
- panel->aura_window()->GetProperty(kShelfIDKey),
- 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);
// Window animations can be triggered during session restore before the shelf
// view is created. In that case, return default empty bounds.
- if (!shelf_view_)
+ if (!shelf_view_ || !id)
return gfx::Rect();
- ShelfID id = window->aura_window()->GetProperty(kShelfIDKey);
- 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_view_unittest.cc ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698