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 "ui/app_list/apps_grid_view.h" | 5 #include "ui/app_list/apps_grid_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/app_list_item_model.h" | |
10 #include "ui/app_list/app_list_item_view.h" | 9 #include "ui/app_list/app_list_item_view.h" |
11 #include "ui/app_list/apps_grid_view_delegate.h" | 10 #include "ui/app_list/apps_grid_view_delegate.h" |
12 #include "ui/app_list/page_switcher.h" | 11 #include "ui/app_list/page_switcher.h" |
13 #include "ui/app_list/pagination_model.h" | 12 #include "ui/app_list/pagination_model.h" |
14 #include "ui/app_list/pulsing_block_view.h" | 13 #include "ui/app_list/pulsing_block_view.h" |
15 #include "ui/base/animation/animation.h" | 14 #include "ui/base/animation/animation.h" |
16 #include "ui/base/events/event.h" | 15 #include "ui/base/events/event.h" |
17 #include "ui/views/border.h" | 16 #include "ui/views/border.h" |
18 #include "ui/views/view_model_utils.h" | 17 #include "ui/views/view_model_utils.h" |
19 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 selected_view_ = NULL; | 315 selected_view_ = NULL; |
317 | 316 |
318 if (drag_view_ == child) | 317 if (drag_view_ == child) |
319 EndDrag(true); | 318 EndDrag(true); |
320 | 319 |
321 bounds_animator_.StopAnimatingView(child); | 320 bounds_animator_.StopAnimatingView(child); |
322 } | 321 } |
323 } | 322 } |
324 | 323 |
325 void AppsGridView::Update() { | 324 void AppsGridView::Update() { |
326 selected_view_ = NULL; | 325 DCHECK(!selected_view_ && !drag_view_); |
| 326 |
327 view_model_.Clear(); | 327 view_model_.Clear(); |
328 if (model_ && model_->apps()->item_count()) | 328 if (model_ && model_->apps()->item_count()) |
329 ListItemsAdded(0, model_->apps()->item_count()); | 329 ListItemsAdded(0, model_->apps()->item_count()); |
330 } | 330 } |
331 | 331 |
332 void AppsGridView::UpdatePaging() { | 332 void AppsGridView::UpdatePaging() { |
333 if (!view_model_.view_size() || !tiles_per_page()) { | 333 if (!view_model_.view_size() || !tiles_per_page()) { |
334 pagination_model_->SetTotalPages(0); | 334 pagination_model_->SetTotalPages(0); |
335 return; | 335 return; |
336 } | 336 } |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 Layout(); | 754 Layout(); |
755 } | 755 } |
756 | 756 |
757 void AppsGridView::OnAppListModelStatusChanged() { | 757 void AppsGridView::OnAppListModelStatusChanged() { |
758 UpdatePulsingBlockViews(); | 758 UpdatePulsingBlockViews(); |
759 Layout(); | 759 Layout(); |
760 SchedulePaint(); | 760 SchedulePaint(); |
761 } | 761 } |
762 | 762 |
763 } // namespace app_list | 763 } // namespace app_list |
OLD | NEW |