OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/launcher/launcher_view.h" | 5 #include "ash/launcher/launcher_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/launcher/app_list_button.h" | 9 #include "ash/launcher/app_list_button.h" |
10 #include "ash/launcher/launcher_button.h" | 10 #include "ash/launcher/launcher_button.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 view_->layer()->SetOpacity(1.0f); | 254 view_->layer()->SetOpacity(1.0f); |
255 } | 255 } |
256 | 256 |
257 private: | 257 private: |
258 LauncherView* launcher_view_; | 258 LauncherView* launcher_view_; |
259 views::View* view_; | 259 views::View* view_; |
260 | 260 |
261 DISALLOW_COPY_AND_ASSIGN(StartFadeAnimationDelegate); | 261 DISALLOW_COPY_AND_ASSIGN(StartFadeAnimationDelegate); |
262 }; | 262 }; |
263 | 263 |
264 LauncherView::LauncherView(LauncherModel* model, LauncherDelegate* delegate) | 264 LauncherView::LauncherView(LauncherModel* model, |
| 265 LauncherDelegate* delegate, |
| 266 ShelfLayoutManager* shelf_layout_manager) |
265 : model_(model), | 267 : model_(model), |
266 delegate_(delegate), | 268 delegate_(delegate), |
267 view_model_(new views::ViewModel), | 269 view_model_(new views::ViewModel), |
268 last_visible_index_(-1), | 270 last_visible_index_(-1), |
269 overflow_button_(NULL), | 271 overflow_button_(NULL), |
270 dragging_(false), | 272 dragging_(false), |
271 drag_view_(NULL), | 273 drag_view_(NULL), |
272 drag_offset_(0), | 274 drag_offset_(0), |
273 start_drag_index_(-1), | 275 start_drag_index_(-1), |
274 context_menu_id_(0), | 276 context_menu_id_(0), |
275 alignment_(SHELF_ALIGNMENT_BOTTOM) { | 277 alignment_(SHELF_ALIGNMENT_BOTTOM) { |
276 DCHECK(model_); | 278 DCHECK(model_); |
277 bounds_animator_.reset(new views::BoundsAnimator(this)); | 279 bounds_animator_.reset(new views::BoundsAnimator(this)); |
278 bounds_animator_->AddObserver(this); | 280 bounds_animator_->AddObserver(this); |
279 set_context_menu_controller(this); | 281 set_context_menu_controller(this); |
280 focus_search_.reset(new LauncherFocusSearch(view_model_.get())); | 282 focus_search_.reset(new LauncherFocusSearch(view_model_.get())); |
281 tooltip_.reset(new LauncherTooltipManager(alignment_)); | 283 tooltip_.reset(new LauncherTooltipManager(alignment_, shelf_layout_manager)); |
282 } | 284 } |
283 | 285 |
284 LauncherView::~LauncherView() { | 286 LauncherView::~LauncherView() { |
285 bounds_animator_->RemoveObserver(this); | 287 bounds_animator_->RemoveObserver(this); |
286 model_->RemoveObserver(this); | 288 model_->RemoveObserver(this); |
287 } | 289 } |
288 | 290 |
289 void LauncherView::Init() { | 291 void LauncherView::Init() { |
290 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 292 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
291 model_->AddObserver(this); | 293 model_->AddObserver(this); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 void LauncherView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) { | 1070 void LauncherView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) { |
1069 FOR_EACH_OBSERVER(LauncherIconObserver, observers_, | 1071 FOR_EACH_OBSERVER(LauncherIconObserver, observers_, |
1070 OnLauncherIconPositionsChanged()); | 1072 OnLauncherIconPositionsChanged()); |
1071 } | 1073 } |
1072 | 1074 |
1073 void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { | 1075 void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { |
1074 } | 1076 } |
1075 | 1077 |
1076 } // namespace internal | 1078 } // namespace internal |
1077 } // namespace ash | 1079 } // namespace ash |
OLD | NEW |