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_item_view.cc

Issue 2680643002: Add old_state parameter to CustomButton::StateChanged (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « ui/app_list/views/app_list_item_view.h ('k') | ui/app_list/views/tile_item_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/views/app_list_item_view.h" 5 #include "ui/app_list/views/app_list_item_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 if (!apps_grid_view_->IsSelectedView(this)) 300 if (!apps_grid_view_->IsSelectedView(this))
301 apps_grid_view_->ClearAnySelectedView(); 301 apps_grid_view_->ClearAnySelectedView();
302 context_menu_runner_.reset(new views::MenuRunner( 302 context_menu_runner_.reset(new views::MenuRunner(
303 menu_model, views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::ASYNC)); 303 menu_model, views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::ASYNC));
304 context_menu_runner_->RunMenuAt(GetWidget(), NULL, 304 context_menu_runner_->RunMenuAt(GetWidget(), NULL,
305 gfx::Rect(point, gfx::Size()), 305 gfx::Rect(point, gfx::Size()),
306 views::MENU_ANCHOR_TOPLEFT, source_type); 306 views::MENU_ANCHOR_TOPLEFT, source_type);
307 } 307 }
308 308
309 void AppListItemView::StateChanged() { 309 void AppListItemView::StateChanged(ButtonState old_state) {
310 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { 310 if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
311 shadow_animator_.animation()->Show(); 311 shadow_animator_.animation()->Show();
312 // Show the hover/tap highlight: for tap, lighter highlight replaces darker 312 // Show the hover/tap highlight: for tap, lighter highlight replaces darker
313 // keyboard selection; for mouse hover, keyboard selection takes precedence. 313 // keyboard selection; for mouse hover, keyboard selection takes precedence.
314 if (!apps_grid_view_->IsSelectedView(this) || state() == STATE_PRESSED) 314 if (!apps_grid_view_->IsSelectedView(this) || state() == STATE_PRESSED)
315 SetItemIsHighlighted(true); 315 SetItemIsHighlighted(true);
316 } else { 316 } else {
317 shadow_animator_.animation()->Hide(); 317 shadow_animator_.animation()->Hide();
318 SetItemIsHighlighted(false); 318 SetItemIsHighlighted(false);
319 if (item_weak_) 319 if (item_weak_)
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 SetItemPercentDownloaded(item_weak_->percent_downloaded()); 515 SetItemPercentDownloaded(item_weak_->percent_downloaded());
516 } 516 }
517 517
518 void AppListItemView::ItemBeingDestroyed() { 518 void AppListItemView::ItemBeingDestroyed() {
519 DCHECK(item_weak_); 519 DCHECK(item_weak_);
520 item_weak_->RemoveObserver(this); 520 item_weak_->RemoveObserver(this);
521 item_weak_ = NULL; 521 item_weak_ = NULL;
522 } 522 }
523 523
524 } // namespace app_list 524 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_item_view.h ('k') | ui/app_list/views/tile_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698