Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ui/app_list/views/app_list_folder_view.cc

Issue 231233004: Fix the bug related to reparent an item from folder which causes the folder item to be removed and … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698