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 "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 return items_grid_view_->OnKeyPressed(event); | 134 return items_grid_view_->OnKeyPressed(event); |
135 } | 135 } |
136 | 136 |
137 void AppListFolderView::OnAppListItemWillBeDeleted(AppListItem* item) { | 137 void AppListFolderView::OnAppListItemWillBeDeleted(AppListItem* item) { |
138 if (item == folder_item_) { | 138 if (item == folder_item_) { |
139 items_grid_view_->OnFolderItemRemoved(); | 139 items_grid_view_->OnFolderItemRemoved(); |
140 folder_header_view_->OnFolderItemRemoved(); | 140 folder_header_view_->OnFolderItemRemoved(); |
141 folder_item_ = NULL; | 141 folder_item_ = NULL; |
142 | 142 |
143 // Do not change state if it is hidden. | 143 // Do not change state if it is hidden. |
144 if (layer()->opacity() == 0.0f) | 144 if (hide_for_reparent_ || layer()->opacity() == 0.0f) |
xiyuan
2014/04/09 22:16:02
Do we still need to test opacity?
jennyz
2014/04/09 22:24:49
The opacity test covers the case folder page is no
| |
145 return; | 145 return; |
146 | 146 |
147 // If the folder item associated with this view is removed from the model, | 147 // If the folder item associated with this view is removed from the model, |
148 // (e.g. the last item in the folder was deleted), reset the view and signal | 148 // (e.g. the last item in the folder was deleted), reset the view and signal |
149 // the container view to show the app list instead. | 149 // the container view to show the app list instead. |
150 // Pass NULL to ShowApps() to avoid triggering animation from the deleted | 150 // Pass NULL to ShowApps() to avoid triggering animation from the deleted |
151 // folder. | 151 // folder. |
152 container_view_->ShowApps(NULL); | 152 container_view_->ShowApps(NULL); |
153 } | 153 } |
154 } | 154 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 void AppListFolderView::GiveBackFocusToSearchBox() { | 315 void AppListFolderView::GiveBackFocusToSearchBox() { |
316 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); | 316 app_list_main_view_->search_box_view()->search_box()->RequestFocus(); |
317 } | 317 } |
318 | 318 |
319 void AppListFolderView::SetItemName(AppListFolderItem* item, | 319 void AppListFolderView::SetItemName(AppListFolderItem* item, |
320 const std::string& name) { | 320 const std::string& name) { |
321 model_->SetItemName(item, name); | 321 model_->SetItemName(item, name); |
322 } | 322 } |
323 | 323 |
324 } // namespace app_list | 324 } // namespace app_list |
OLD | NEW |