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

Side by Side Diff: ash/common/shelf/shelf_widget.cc

Issue 2731663002: Remove WmWindowProperty (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/shelf/shelf_widget.h" 5 #include "ash/common/shelf/shelf_widget.h"
6 6
7 #include "ash/animation/animation_change_type.h" 7 #include "ash/animation/animation_change_type.h"
8 #include "ash/common/focus_cycler.h" 8 #include "ash/common/focus_cycler.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/app_list_button.h" 10 #include "ash/common/shelf/app_list_button.h"
11 #include "ash/common/shelf/shelf_background_animator_observer.h" 11 #include "ash/common/shelf/shelf_background_animator_observer.h"
12 #include "ash/common/shelf/shelf_constants.h" 12 #include "ash/common/shelf/shelf_constants.h"
13 #include "ash/common/shelf/shelf_delegate.h" 13 #include "ash/common/shelf/shelf_delegate.h"
14 #include "ash/common/shelf/shelf_layout_manager.h" 14 #include "ash/common/shelf/shelf_layout_manager.h"
15 #include "ash/common/shelf/shelf_view.h" 15 #include "ash/common/shelf/shelf_view.h"
16 #include "ash/common/shelf/wm_shelf.h" 16 #include "ash/common/shelf/wm_shelf.h"
17 #include "ash/common/shelf/wm_shelf_util.h" 17 #include "ash/common/shelf/wm_shelf_util.h"
18 #include "ash/common/system/status_area_layout_manager.h" 18 #include "ash/common/system/status_area_layout_manager.h"
19 #include "ash/common/system/status_area_widget.h" 19 #include "ash/common/system/status_area_widget.h"
20 #include "ash/common/wm_lookup.h" 20 #include "ash/common/wm_lookup.h"
21 #include "ash/common/wm_shell.h" 21 #include "ash/common/wm_shell.h"
22 #include "ash/common/wm_window.h" 22 #include "ash/common/wm_window.h"
23 #include "ash/common/wm_window_property.h"
24 #include "ash/root_window_controller.h" 23 #include "ash/root_window_controller.h"
24 #include "ash/wm/window_properties.h"
25 #include "base/memory/ptr_util.h" 25 #include "base/memory/ptr_util.h"
26 #include "ui/compositor/layer.h" 26 #include "ui/compositor/layer.h"
27 #include "ui/compositor/scoped_layer_animation_settings.h" 27 #include "ui/compositor/scoped_layer_animation_settings.h"
28 #include "ui/gfx/skbitmap_operations.h" 28 #include "ui/gfx/skbitmap_operations.h"
29 #include "ui/views/accessible_pane_view.h" 29 #include "ui/views/accessible_pane_view.h"
30 #include "ui/views/layout/fill_layout.h" 30 #include "ui/views/layout/fill_layout.h"
31 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
32 #include "ui/views/widget/widget_delegate.h" 32 #include "ui/views/widget/widget_delegate.h"
33 33
34 namespace ash { 34 namespace ash {
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 CloseNow(); 302 CloseNow();
303 } 303 }
304 304
305 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) { 305 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
306 if (!shelf_view_) 306 if (!shelf_view_)
307 return; 307 return;
308 308
309 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this); 309 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this);
310 shelf_view_->UpdatePanelIconPosition( 310 shelf_view_->UpdatePanelIconPosition(
311 panel->GetIntProperty(WmWindowProperty::SHELF_ID), 311 panel->aura_window()->GetProperty(kShelfIDKey),
312 shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen()) 312 shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen())
313 .CenterPoint()); 313 .CenterPoint());
314 } 314 }
315 315
316 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { 316 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
317 // Window animations can be triggered during session restore before the shelf 317 // Window animations can be triggered during session restore before the shelf
318 // view is created. In that case, return default empty bounds. 318 // view is created. In that case, return default empty bounds.
319 if (!shelf_view_) 319 if (!shelf_view_)
320 return gfx::Rect(); 320 return gfx::Rect();
321 321
322 ShelfID id = window->GetIntProperty(WmWindowProperty::SHELF_ID); 322 ShelfID id = window->aura_window()->GetProperty(kShelfIDKey);
323 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); 323 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id));
324 gfx::Point screen_origin; 324 gfx::Point screen_origin;
325 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); 325 views::View::ConvertPointToScreen(shelf_view_, &screen_origin);
326 return gfx::Rect(screen_origin.x() + bounds.x(), 326 return gfx::Rect(screen_origin.x() + bounds.x(),
327 screen_origin.y() + bounds.y(), bounds.width(), 327 screen_origin.y() + bounds.y(), bounds.width(),
328 bounds.height()); 328 bounds.height());
329 } 329 }
330 330
331 AppListButton* ShelfWidget::GetAppListButton() const { 331 AppListButton* ShelfWidget::GetAppListButton() const {
332 return shelf_view_ ? shelf_view_->GetAppListButton() : nullptr; 332 return shelf_view_ ? shelf_view_->GetAppListButton() : nullptr;
(...skipping 17 matching lines...) Expand all
350 if (shelf_view_) 350 if (shelf_view_)
351 shelf_view_->UpdateShelfItemBackground(color); 351 shelf_view_->UpdateShelfItemBackground(color);
352 } 352 }
353 353
354 void ShelfWidget::WillDeleteShelfLayoutManager() { 354 void ShelfWidget::WillDeleteShelfLayoutManager() {
355 shelf_layout_manager_->RemoveObserver(this); 355 shelf_layout_manager_->RemoveObserver(this);
356 shelf_layout_manager_ = nullptr; 356 shelf_layout_manager_ = nullptr;
357 } 357 }
358 358
359 } // namespace ash 359 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698