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

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

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content 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_alignment_menu.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_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
(...skipping 26 matching lines...) Expand all
37 #include "ui/views/widget/widget.h" 37 #include "ui/views/widget/widget.h"
38 #include "ui/views/widget/widget_delegate.h" 38 #include "ui/views/widget/widget_delegate.h"
39 #include "ui/wm/public/activation_client.h" 39 #include "ui/wm/public/activation_client.h"
40 40
41 namespace ash { 41 namespace ash {
42 42
43 const char Shelf::kNativeViewName[] = "ShelfView"; 43 const char Shelf::kNativeViewName[] = "ShelfView";
44 44
45 Shelf::Shelf(ShelfModel* shelf_model, 45 Shelf::Shelf(ShelfModel* shelf_model,
46 ShelfDelegate* shelf_delegate, 46 ShelfDelegate* shelf_delegate,
47 WmShelf* wm_shelf,
47 ShelfWidget* shelf_widget) 48 ShelfWidget* shelf_widget)
48 : delegate_(shelf_delegate), 49 : delegate_(shelf_delegate),
50 wm_shelf_(wm_shelf),
49 shelf_widget_(shelf_widget), 51 shelf_widget_(shelf_widget),
50 shelf_view_(new ShelfView(shelf_model, delegate_, this)), 52 shelf_view_(new ShelfView(shelf_model, delegate_, wm_shelf, this)),
51 shelf_locking_manager_(this) { 53 shelf_locking_manager_(this) {
54 DCHECK(wm_shelf_);
52 shelf_view_->Init(); 55 shelf_view_->Init();
53 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); 56 shelf_widget_->GetContentsView()->AddChildView(shelf_view_);
54 shelf_widget_->GetNativeView()->SetName(kNativeViewName); 57 shelf_widget_->GetNativeView()->SetName(kNativeViewName);
55 } 58 }
56 59
57 Shelf::~Shelf() { 60 Shelf::~Shelf() {
58 delegate_->OnShelfDestroyed(this); 61 delegate_->OnShelfDestroyed(this);
59 } 62 }
60 63
61 // static 64 // static
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 226
224 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { 227 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const {
225 return shelf_view_->GetVisibleItemsBoundsInScreen(); 228 return shelf_view_->GetVisibleItemsBoundsInScreen();
226 } 229 }
227 230
228 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { 231 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() {
229 return shelf_view_; 232 return shelf_view_;
230 } 233 }
231 234
232 } // namespace ash 235 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf.h ('k') | ash/shelf/shelf_alignment_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698