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