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

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

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Clean up include and modify comment. 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
« no previous file with comments | « ash/common/shelf/shelf_view.cc ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
21 #include "ash/common/wm_shell.h" 20 #include "ash/common/wm_shell.h"
22 #include "ash/common/wm_window.h" 21 #include "ash/common/wm_window.h"
23 #include "ash/common/wm_window_property.h" 22 #include "ash/common/wm_window_property.h"
24 #include "ash/root_window_controller.h" 23 #include "ash/root_window_controller.h"
25 #include "base/memory/ptr_util.h" 24 #include "base/memory/ptr_util.h"
26 #include "ui/compositor/layer.h" 25 #include "ui/compositor/layer.h"
27 #include "ui/compositor/scoped_layer_animation_settings.h" 26 #include "ui/compositor/scoped_layer_animation_settings.h"
28 #include "ui/gfx/skbitmap_operations.h" 27 #include "ui/gfx/skbitmap_operations.h"
29 #include "ui/views/accessible_pane_view.h" 28 #include "ui/views/accessible_pane_view.h"
30 #include "ui/views/layout/fill_layout.h" 29 #include "ui/views/layout/fill_layout.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 status_area_widget_ = nullptr; 298 status_area_widget_ = nullptr;
300 } 299 }
301 300
302 CloseNow(); 301 CloseNow();
303 } 302 }
304 303
305 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) { 304 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
306 if (!shelf_view_) 305 if (!shelf_view_)
307 return; 306 return;
308 307
309 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this); 308 WmWindow* shelf_window = WmWindow::Get(this->GetNativeWindow());
310 shelf_view_->UpdatePanelIconPosition( 309 shelf_view_->UpdatePanelIconPosition(
311 panel->GetIntProperty(WmWindowProperty::SHELF_ID), 310 panel->GetIntProperty(WmWindowProperty::SHELF_ID),
312 shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen()) 311 shelf_window->ConvertRectFromScreen(panel->GetBoundsInScreen())
313 .CenterPoint()); 312 .CenterPoint());
314 } 313 }
315 314
316 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { 315 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
317 // Window animations can be triggered during session restore before the shelf 316 // Window animations can be triggered during session restore before the shelf
318 // view is created. In that case, return default empty bounds. 317 // view is created. In that case, return default empty bounds.
319 if (!shelf_view_) 318 if (!shelf_view_)
(...skipping 30 matching lines...) Expand all
350 if (shelf_view_) 349 if (shelf_view_)
351 shelf_view_->UpdateShelfItemBackground(color); 350 shelf_view_->UpdateShelfItemBackground(color);
352 } 351 }
353 352
354 void ShelfWidget::WillDeleteShelfLayoutManager() { 353 void ShelfWidget::WillDeleteShelfLayoutManager() {
355 shelf_layout_manager_->RemoveObserver(this); 354 shelf_layout_manager_->RemoveObserver(this);
356 shelf_layout_manager_ = nullptr; 355 shelf_layout_manager_ = nullptr;
357 } 356 }
358 357
359 } // namespace ash 358 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_view.cc ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698