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

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

Issue 2177663002: mash: Move ownership of ShelfDelegate to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix WallpaperManagerBrowserTest Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shelf/shelf.h" 5 #include "ash/shelf/shelf.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "ash/aura/wm_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
11 #include "ash/common/shelf/shelf_delegate.h"
11 #include "ash/common/shelf/shelf_item_delegate.h" 12 #include "ash/common/shelf/shelf_item_delegate.h"
12 #include "ash/common/shelf/shelf_model.h" 13 #include "ash/common/shelf/shelf_model.h"
13 #include "ash/common/shelf/shelf_navigator.h" 14 #include "ash/common/shelf/shelf_navigator.h"
14 #include "ash/common/shelf/wm_shelf_util.h" 15 #include "ash/common/shelf/wm_shelf_util.h"
15 #include "ash/common/shell_window_ids.h" 16 #include "ash/common/shell_window_ids.h"
16 #include "ash/root_window_controller.h" 17 #include "ash/root_window_controller.h"
17 #include "ash/screen_util.h" 18 #include "ash/screen_util.h"
18 #include "ash/shelf/shelf_delegate.h"
19 #include "ash/shelf/shelf_layout_manager.h" 19 #include "ash/shelf/shelf_layout_manager.h"
20 #include "ash/shelf/shelf_util.h" 20 #include "ash/shelf/shelf_util.h"
21 #include "ash/shelf/shelf_view.h" 21 #include "ash/shelf/shelf_view.h"
22 #include "ash/shell.h" 22 #include "ash/shell.h"
23 #include "ash/wm/window_properties.h" 23 #include "ash/wm/window_properties.h"
24 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
25 #include "ui/aura/window_event_dispatcher.h" 25 #include "ui/aura/window_event_dispatcher.h"
26 #include "ui/aura/window_observer.h" 26 #include "ui/aura/window_observer.h"
27 #include "ui/compositor/layer.h" 27 #include "ui/compositor/layer.h"
28 #include "ui/gfx/canvas.h" 28 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/image/image.h" 29 #include "ui/gfx/image/image.h"
30 #include "ui/gfx/image/image_skia_operations.h" 30 #include "ui/gfx/image/image_skia_operations.h"
31 #include "ui/gfx/skbitmap_operations.h" 31 #include "ui/gfx/skbitmap_operations.h"
32 #include "ui/views/accessible_pane_view.h" 32 #include "ui/views/accessible_pane_view.h"
33 #include "ui/views/widget/widget.h" 33 #include "ui/views/widget/widget.h"
34 #include "ui/views/widget/widget_delegate.h" 34 #include "ui/views/widget/widget_delegate.h"
35 #include "ui/wm/public/activation_client.h" 35 #include "ui/wm/public/activation_client.h"
36 36
37 namespace ash { 37 namespace ash {
38 38
39 const char Shelf::kNativeViewName[] = "ShelfView"; 39 const char Shelf::kNativeViewName[] = "ShelfView";
40 40
41 Shelf::Shelf(ShelfModel* shelf_model, 41 Shelf::Shelf(ShelfModel* shelf_model,
42 ShelfDelegate* shelf_delegate, 42 ShelfDelegate* shelf_delegate,
43 WmShelf* wm_shelf, 43 WmShelf* wm_shelf,
44 ShelfWidget* shelf_widget) 44 ShelfWidget* shelf_widget)
45 : delegate_(shelf_delegate), 45 : delegate_(shelf_delegate),
msw 2016/07/23 00:02:36 optional nit: remove this argument and member (and
James Cook 2016/07/23 00:38:03 Ordinarily I prefer dependency injection, but give
46 wm_shelf_(wm_shelf), 46 wm_shelf_(wm_shelf),
47 shelf_widget_(shelf_widget), 47 shelf_widget_(shelf_widget),
48 shelf_view_(new ShelfView(shelf_model, delegate_, wm_shelf, this)), 48 shelf_view_(new ShelfView(shelf_model, delegate_, wm_shelf, this)),
49 shelf_locking_manager_(wm_shelf) { 49 shelf_locking_manager_(wm_shelf) {
50 DCHECK(wm_shelf_); 50 DCHECK(wm_shelf_);
51 shelf_view_->Init(); 51 shelf_view_->Init();
52 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); 52 shelf_widget_->GetContentsView()->AddChildView(shelf_view_);
53 shelf_widget_->GetNativeView()->SetName(kNativeViewName); 53 shelf_widget_->GetNativeView()->SetName(kNativeViewName);
54 } 54 }
55 55
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { 209 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const {
210 return shelf_view_->GetVisibleItemsBoundsInScreen(); 210 return shelf_view_->GetVisibleItemsBoundsInScreen();
211 } 211 }
212 212
213 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { 213 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() {
214 return shelf_view_; 214 return shelf_view_;
215 } 215 }
216 216
217 } // namespace ash 217 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698