| OLD | NEW |
| 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 "ui/app_list/views/app_list_folder_view.h" | 5 #include "ui/app_list/views/app_list_folder_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/accessibility/ax_node_data.h" | 9 #include "ui/accessibility/ax_node_data.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_folder_item.h" | 11 #include "ui/app_list/app_list_folder_item.h" |
| 12 #include "ui/app_list/app_list_model.h" | 12 #include "ui/app_list/app_list_model.h" |
| 13 #include "ui/app_list/views/app_list_item_view.h" | 13 #include "ui/app_list/views/app_list_item_view.h" |
| 14 #include "ui/app_list/views/app_list_main_view.h" | 14 #include "ui/app_list/views/app_list_main_view.h" |
| 15 #include "ui/app_list/views/apps_container_view.h" | 15 #include "ui/app_list/views/apps_container_view.h" |
| 16 #include "ui/app_list/views/apps_grid_view.h" | 16 #include "ui/app_list/views/apps_grid_view.h" |
| 17 #include "ui/app_list/views/contents_view.h" | 17 #include "ui/app_list/views/contents_view.h" |
| 18 #include "ui/app_list/views/folder_background_view.h" | 18 #include "ui/app_list/views/folder_background_view.h" |
| 19 #include "ui/app_list/views/folder_header_view.h" | 19 #include "ui/app_list/views/folder_header_view.h" |
| 20 #include "ui/app_list/views/search_box_view.h" | 20 #include "ui/app_list/views/search_box_view.h" |
| 21 #include "ui/compositor/layer_type.h" |
| 21 #include "ui/compositor/scoped_layer_animation_settings.h" | 22 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 22 #include "ui/events/event.h" | 23 #include "ui/events/event.h" |
| 23 #include "ui/gfx/geometry/rect_conversions.h" | 24 #include "ui/gfx/geometry/rect_conversions.h" |
| 24 #include "ui/strings/grit/ui_strings.h" | 25 #include "ui/strings/grit/ui_strings.h" |
| 25 #include "ui/views/controls/textfield/textfield.h" | 26 #include "ui/views/controls/textfield/textfield.h" |
| 26 #include "ui/views/view_model.h" | 27 #include "ui/views/view_model.h" |
| 27 #include "ui/views/view_model_utils.h" | 28 #include "ui/views/view_model_utils.h" |
| 28 | 29 |
| 29 namespace app_list { | 30 namespace app_list { |
| 30 | 31 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 56 | 57 |
| 57 items_grid_view_ = new AppsGridView(app_list_main_view_); | 58 items_grid_view_ = new AppsGridView(app_list_main_view_); |
| 58 items_grid_view_->set_folder_delegate(this); | 59 items_grid_view_->set_folder_delegate(this); |
| 59 items_grid_view_->SetLayout( | 60 items_grid_view_->SetLayout( |
| 60 container_view->apps_grid_view()->cols(), | 61 container_view->apps_grid_view()->cols(), |
| 61 container_view->apps_grid_view()->rows_per_page()); | 62 container_view->apps_grid_view()->rows_per_page()); |
| 62 items_grid_view_->SetModel(model); | 63 items_grid_view_->SetModel(model); |
| 63 AddChildView(items_grid_view_); | 64 AddChildView(items_grid_view_); |
| 64 view_model_->Add(items_grid_view_, kIndexChildItems); | 65 view_model_->Add(items_grid_view_, kIndexChildItems); |
| 65 | 66 |
| 66 SetPaintToLayer(true); | 67 SetPaintToLayer(ui::LAYER_TEXTURED); |
| 67 layer()->SetFillsBoundsOpaquely(false); | 68 layer()->SetFillsBoundsOpaquely(false); |
| 68 | 69 |
| 69 model_->AddObserver(this); | 70 model_->AddObserver(this); |
| 70 } | 71 } |
| 71 | 72 |
| 72 AppListFolderView::~AppListFolderView() { | 73 AppListFolderView::~AppListFolderView() { |
| 73 model_->RemoveObserver(this); | 74 model_->RemoveObserver(this); |
| 74 | 75 |
| 75 // This prevents the AppsGridView's destructor from calling the now-deleted | 76 // This prevents the AppsGridView's destructor from calling the now-deleted |
| 76 // AppListFolderView's methods if a drag is in progress at the time. | 77 // AppListFolderView's methods if a drag is in progress at the time. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 void AppListFolderView::GiveBackFocusToSearchBox() { | 344 void AppListFolderView::GiveBackFocusToSearchBox() { |
| 344 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); | 345 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); |
| 345 } | 346 } |
| 346 | 347 |
| 347 void AppListFolderView::SetItemName(AppListFolderItem* item, | 348 void AppListFolderView::SetItemName(AppListFolderItem* item, |
| 348 const std::string& name) { | 349 const std::string& name) { |
| 349 model_->SetItemName(item, name); | 350 model_->SetItemName(item, name); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace app_list | 353 } // namespace app_list |
| OLD | NEW |