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

Side by Side Diff: ui/app_list/app_list_item_view.cc

Issue 10961020: cros: Fix mouse over-scroll animation not happening. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix jumping around when mouse is hovering on an item Created 8 years, 3 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 | « ash/wm/app_list_controller.cc ('k') | ui/app_list/apps_grid_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/app_list_item_view.h" 5 #include "ui/app_list/app_list_item_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/app_list/app_list_constants.h" 10 #include "ui/app_list/app_list_constants.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 menu_adapter.BuildMenu(context_menu_runner_->GetMenu()); 209 menu_adapter.BuildMenu(context_menu_runner_->GetMenu());
210 if (context_menu_runner_->RunMenuAt( 210 if (context_menu_runner_->RunMenuAt(
211 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), 211 GetWidget(), NULL, gfx::Rect(point, gfx::Size()),
212 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == 212 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) ==
213 views::MenuRunner::MENU_DELETED) 213 views::MenuRunner::MENU_DELETED)
214 return; 214 return;
215 } 215 }
216 216
217 void AppListItemView::StateChanged() { 217 void AppListItemView::StateChanged() {
218 if (state() == BS_HOT || state() == BS_PUSHED) { 218 if (state() == BS_HOT || state() == BS_PUSHED) {
219 apps_grid_view_->SetSelectedItem(this); 219 // Don't auto select item if there is a running page transition.
220 if (!apps_grid_view_->HasPageTransition())
221 apps_grid_view_->SetSelectedItem(this);
220 title_->SetEnabledColor(kTitleHoverColor); 222 title_->SetEnabledColor(kTitleHoverColor);
221 } else { 223 } else {
222 apps_grid_view_->ClearSelectedItem(this); 224 apps_grid_view_->ClearSelectedItem(this);
223 model_->SetHighlighted(false); 225 model_->SetHighlighted(false);
224 title_->SetEnabledColor(kTitleColor); 226 title_->SetEnabledColor(kTitleColor);
225 } 227 }
226 } 228 }
227 229
228 bool AppListItemView::ShouldEnterPushedState(const ui::Event& event) { 230 bool AppListItemView::ShouldEnterPushedState(const ui::Event& event) {
229 // Don't enter pushed state for ET_GESTURE_TAP_DOWN so that hover gray 231 // Don't enter pushed state for ET_GESTURE_TAP_DOWN so that hover gray
230 // background does not show up during scroll. 232 // background does not show up during scroll.
231 if (event.type() == ui::ET_GESTURE_TAP_DOWN) 233 if (event.type() == ui::ET_GESTURE_TAP_DOWN)
232 return false; 234 return false;
233 235
234 return views::CustomButton::ShouldEnterPushedState(event); 236 return views::CustomButton::ShouldEnterPushedState(event);
235 } 237 }
236 238
237 } // namespace app_list 239 } // namespace app_list
OLDNEW
« no previous file with comments | « ash/wm/app_list_controller.cc ('k') | ui/app_list/apps_grid_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698