| 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/views/contents_view.h" | 5 #include "ui/app_list/views/contents_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| 11 #include "ui/app_list/app_list_switches.h" | 11 #include "ui/app_list/app_list_switches.h" |
| 12 #include "ui/app_list/app_list_view_delegate.h" | 12 #include "ui/app_list/app_list_view_delegate.h" |
| 13 #include "ui/app_list/pagination_model.h" | 13 #include "ui/app_list/pagination_model.h" |
| 14 #include "ui/app_list/views/app_list_folder_view.h" |
| 14 #include "ui/app_list/views/app_list_main_view.h" | 15 #include "ui/app_list/views/app_list_main_view.h" |
| 15 #include "ui/app_list/views/apps_container_view.h" | 16 #include "ui/app_list/views/apps_container_view.h" |
| 16 #include "ui/app_list/views/apps_grid_view.h" | 17 #include "ui/app_list/views/apps_grid_view.h" |
| 17 #include "ui/app_list/views/search_result_list_view.h" | 18 #include "ui/app_list/views/search_result_list_view.h" |
| 18 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
| 19 #include "ui/views/animation/bounds_animator.h" | 20 #include "ui/views/animation/bounds_animator.h" |
| 20 #include "ui/views/view_model.h" | 21 #include "ui/views/view_model.h" |
| 21 #include "ui/views/view_model_utils.h" | 22 #include "ui/views/view_model_utils.h" |
| 22 | 23 |
| 23 namespace app_list { | 24 namespace app_list { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 GetSearchResultListView(view_model_.get())->SetResults(model->results()); | 72 GetSearchResultListView(view_model_.get())->SetResults(model->results()); |
| 72 } | 73 } |
| 73 | 74 |
| 74 ContentsView::~ContentsView() { | 75 ContentsView::~ContentsView() { |
| 75 } | 76 } |
| 76 | 77 |
| 77 void ContentsView::CancelDrag() { | 78 void ContentsView::CancelDrag() { |
| 78 if (apps_container_view_->apps_grid_view()->has_dragged_view()) | 79 if (apps_container_view_->apps_grid_view()->has_dragged_view()) |
| 79 apps_container_view_->apps_grid_view()->EndDrag(true); | 80 apps_container_view_->apps_grid_view()->EndDrag(true); |
| 81 if (apps_container_view_->app_list_folder_view() |
| 82 ->items_grid_view() |
| 83 ->has_dragged_view()) { |
| 84 apps_container_view_->app_list_folder_view()->items_grid_view()->EndDrag( |
| 85 true); |
| 86 } |
| 80 } | 87 } |
| 81 | 88 |
| 82 void ContentsView::SetDragAndDropHostOfCurrentAppList( | 89 void ContentsView::SetDragAndDropHostOfCurrentAppList( |
| 83 ApplicationDragAndDropHost* drag_and_drop_host) { | 90 ApplicationDragAndDropHost* drag_and_drop_host) { |
| 84 apps_container_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); | 91 apps_container_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
| 85 } | 92 } |
| 86 | 93 |
| 87 void ContentsView::SetShowState(ShowState show_state) { | 94 void ContentsView::SetShowState(ShowState show_state) { |
| 88 if (show_state_ == show_state) | 95 if (show_state_ == show_state) |
| 89 return; | 96 return; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (!pagination_model_->has_transition()) { | 285 if (!pagination_model_->has_transition()) { |
| 279 pagination_model_->SelectPageRelative(offset > 0 ? -1 : 1, | 286 pagination_model_->SelectPageRelative(offset > 0 ? -1 : 1, |
| 280 true); | 287 true); |
| 281 } | 288 } |
| 282 event->SetHandled(); | 289 event->SetHandled(); |
| 283 event->StopPropagation(); | 290 event->StopPropagation(); |
| 284 } | 291 } |
| 285 } | 292 } |
| 286 | 293 |
| 287 } // namespace app_list | 294 } // namespace app_list |
| OLD | NEW |