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/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
10 #include "ui/app_list/app_list_folder_item.h" | 10 #include "ui/app_list/app_list_folder_item.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 view_model_(new views::ViewModel), | 49 view_model_(new views::ViewModel), |
50 model_(model), | 50 model_(model), |
51 folder_item_(NULL), | 51 folder_item_(NULL), |
52 pagination_model_(new PaginationModel), | 52 pagination_model_(new PaginationModel), |
53 hide_for_reparent_(false) { | 53 hide_for_reparent_(false) { |
54 AddChildView(folder_header_view_); | 54 AddChildView(folder_header_view_); |
55 view_model_->Add(folder_header_view_, kIndexFolderHeader); | 55 view_model_->Add(folder_header_view_, kIndexFolderHeader); |
56 | 56 |
57 items_grid_view_ = | 57 items_grid_view_ = |
58 new AppsGridView(app_list_main_view_, pagination_model_.get()); | 58 new AppsGridView(app_list_main_view_, pagination_model_.get()); |
59 items_grid_view_->set_is_root_level(false); | 59 items_grid_view_->set_folder_delegate(this); |
60 items_grid_view_->SetLayout( | 60 items_grid_view_->SetLayout( |
61 kPreferredIconDimension, | 61 kPreferredIconDimension, |
62 container_view->apps_grid_view()->cols(), | 62 container_view->apps_grid_view()->cols(), |
63 container_view->apps_grid_view()->rows_per_page()); | 63 container_view->apps_grid_view()->rows_per_page()); |
64 items_grid_view_->SetModel(model); | 64 items_grid_view_->SetModel(model); |
65 AddChildView(items_grid_view_); | 65 AddChildView(items_grid_view_); |
66 view_model_->Add(items_grid_view_, kIndexChildItems); | 66 view_model_->Add(items_grid_view_, kIndexChildItems); |
67 | 67 |
68 #if defined(USE_AURA) | 68 #if defined(USE_AURA) |
69 SetPaintToLayer(true); | 69 SetPaintToLayer(true); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 container_view_->folder_background_view()->UpdateFolderContainerBubble( | 220 container_view_->folder_background_view()->UpdateFolderContainerBubble( |
221 show_bubble ? FolderBackgroundView::SHOW_BUBBLE : | 221 show_bubble ? FolderBackgroundView::SHOW_BUBBLE : |
222 FolderBackgroundView::HIDE_BUBBLE); | 222 FolderBackgroundView::HIDE_BUBBLE); |
223 } | 223 } |
224 | 224 |
225 void AppListFolderView::UpdateFolderNameVisibility(bool visible) { | 225 void AppListFolderView::UpdateFolderNameVisibility(bool visible) { |
226 folder_header_view_->UpdateFolderNameVisibility(visible); | 226 folder_header_view_->UpdateFolderNameVisibility(visible); |
227 } | 227 } |
228 | 228 |
229 bool AppListFolderView::IsPointOutsideOfFolderBoundray( | 229 bool AppListFolderView::IsPointOutsideOfFolderBoundary( |
230 const gfx::Point& point) { | 230 const gfx::Point& point) { |
231 if (!GetLocalBounds().Contains(point)) | 231 if (!GetLocalBounds().Contains(point)) |
232 return true; | 232 return true; |
233 | 233 |
234 gfx::Point center = GetLocalBounds().CenterPoint(); | 234 gfx::Point center = GetLocalBounds().CenterPoint(); |
235 float delta = (point - center).Length(); | 235 float delta = (point - center).Length(); |
236 return delta > container_view_->folder_background_view()-> | 236 return delta > container_view_->folder_background_view()-> |
237 GetFolderContainerBubbleRadius() + kOutOfFolderContainerBubbleDelta; | 237 GetFolderContainerBubbleRadius() + kOutOfFolderContainerBubbleDelta; |
238 } | 238 } |
239 | 239 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 void AppListFolderView::GiveBackFocusToSearchBox() { | 289 void AppListFolderView::GiveBackFocusToSearchBox() { |
290 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); | 290 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); |
291 } | 291 } |
292 | 292 |
293 void AppListFolderView::SetItemName(AppListFolderItem* item, | 293 void AppListFolderView::SetItemName(AppListFolderItem* item, |
294 const std::string& name) { | 294 const std::string& name) { |
295 model_->SetItemName(item, name); | 295 model_->SetItemName(item, name); |
296 } | 296 } |
297 | 297 |
298 } // namespace app_list | 298 } // namespace app_list |
OLD | NEW |