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

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

Issue 2041583004: mash: Move WmShelfAura ownership to RootWindowController and init it earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveshelftypes
Patch Set: . Created 4 years, 6 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/shelf/shelf.h ('k') | ash/shelf/shelf_widget.h » ('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 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_shelf_aura.h"
11 #include "ash/common/shelf/wm_shelf_util.h" 10 #include "ash/common/shelf/wm_shelf_util.h"
12 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
13 #include "ash/focus_cycler.h" 12 #include "ash/focus_cycler.h"
14 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
15 #include "ash/root_window_settings.h" 14 #include "ash/root_window_settings.h"
16 #include "ash/screen_util.h" 15 #include "ash/screen_util.h"
17 #include "ash/shelf/shelf_delegate.h" 16 #include "ash/shelf/shelf_delegate.h"
18 #include "ash/shelf/shelf_item_delegate.h" 17 #include "ash/shelf/shelf_item_delegate.h"
19 #include "ash/shelf/shelf_item_delegate_manager.h" 18 #include "ash/shelf/shelf_item_delegate_manager.h"
20 #include "ash/shelf/shelf_layout_manager.h" 19 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 23 matching lines...) Expand all
44 Shelf::Shelf(ShelfModel* shelf_model, 43 Shelf::Shelf(ShelfModel* shelf_model,
45 ShelfDelegate* shelf_delegate, 44 ShelfDelegate* shelf_delegate,
46 ShelfWidget* shelf_widget) 45 ShelfWidget* shelf_widget)
47 : delegate_(shelf_delegate), 46 : delegate_(shelf_delegate),
48 shelf_widget_(shelf_widget), 47 shelf_widget_(shelf_widget),
49 shelf_view_(new ShelfView(shelf_model, delegate_, this)), 48 shelf_view_(new ShelfView(shelf_model, delegate_, this)),
50 shelf_locking_manager_(this) { 49 shelf_locking_manager_(this) {
51 shelf_view_->Init(); 50 shelf_view_->Init();
52 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); 51 shelf_widget_->GetContentsView()->AddChildView(shelf_view_);
53 shelf_widget_->GetNativeView()->SetName(kNativeViewName); 52 shelf_widget_->GetNativeView()->SetName(kNativeViewName);
54 // This has to be done after the ShelfWidget and ShelfLayoutManager have
55 // been created.
56 wm_shelf_.reset(new WmShelfAura(this));
57 } 53 }
58 54
59 Shelf::~Shelf() { 55 Shelf::~Shelf() {
60 delegate_->OnShelfDestroyed(this); 56 delegate_->OnShelfDestroyed(this);
61 } 57 }
62 58
63 // static 59 // static
64 Shelf* Shelf::ForPrimaryDisplay() { 60 Shelf* Shelf::ForPrimaryDisplay() {
65 return Shelf::ForWindow(Shell::GetPrimaryRootWindow()); 61 return Shelf::ForWindow(Shell::GetPrimaryRootWindow());
66 } 62 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 221
226 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { 222 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const {
227 return shelf_view_->GetVisibleItemsBoundsInScreen(); 223 return shelf_view_->GetVisibleItemsBoundsInScreen();
228 } 224 }
229 225
230 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { 226 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() {
231 return shelf_view_; 227 return shelf_view_;
232 } 228 }
233 229
234 } // namespace ash 230 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf.h ('k') | ash/shelf/shelf_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698