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

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

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont move declaration randomly Created 4 years, 11 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
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return; 137 return;
138 } 138 }
139 139
140 gfx::ImageSkia resized(gfx::ImageSkiaOperations::CreateResizedImage( 140 gfx::ImageSkia resized(gfx::ImageSkiaOperations::CreateResizedImage(
141 icon, 141 icon,
142 skia::ImageOperations::RESIZE_BEST, 142 skia::ImageOperations::RESIZE_BEST,
143 gfx::Size(kGridIconDimension, kGridIconDimension))); 143 gfx::Size(kGridIconDimension, kGridIconDimension)));
144 shadow_animator_.SetOriginalImage(resized); 144 shadow_animator_.SetOriginalImage(resized);
145 } 145 }
146 146
147 void AppListItemView::SetUIState(UIState state) { 147 void AppListItemView::SetUIState(UIState ui_state) {
148 if (ui_state_ == state) 148 if (ui_state_ == ui_state)
149 return; 149 return;
150 150
151 ui_state_ = state; 151 ui_state_ = ui_state;
152 152
153 switch (ui_state_) { 153 switch (ui_state_) {
154 case UI_STATE_NORMAL: 154 case UI_STATE_NORMAL:
155 title_->SetVisible(!is_installing_); 155 title_->SetVisible(!is_installing_);
156 progress_bar_->SetVisible(is_installing_); 156 progress_bar_->SetVisible(is_installing_);
157 break; 157 break;
158 case UI_STATE_DRAGGING: 158 case UI_STATE_DRAGGING:
159 title_->SetVisible(false); 159 title_->SetVisible(false);
160 progress_bar_->SetVisible(false); 160 progress_bar_->SetVisible(false);
161 break; 161 break;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 break; 460 break;
461 case ui::ET_GESTURE_SCROLL_END: 461 case ui::ET_GESTURE_SCROLL_END:
462 case ui::ET_SCROLL_FLING_START: 462 case ui::ET_SCROLL_FLING_START:
463 if (touch_dragging_) { 463 if (touch_dragging_) {
464 SetTouchDragging(false); 464 SetTouchDragging(false);
465 apps_grid_view_->EndDrag(false); 465 apps_grid_view_->EndDrag(false);
466 event->SetHandled(); 466 event->SetHandled();
467 } 467 }
468 break; 468 break;
469 case ui::ET_GESTURE_TAP_DOWN: 469 case ui::ET_GESTURE_TAP_DOWN:
470 if (::switches::IsTouchFeedbackEnabled() && state_ != STATE_DISABLED) { 470 if (::switches::IsTouchFeedbackEnabled() && state() != STATE_DISABLED) {
471 SetState(STATE_PRESSED); 471 SetState(STATE_PRESSED);
472 event->SetHandled(); 472 event->SetHandled();
473 } 473 }
474 break; 474 break;
475 case ui::ET_GESTURE_TAP: 475 case ui::ET_GESTURE_TAP:
476 case ui::ET_GESTURE_TAP_CANCEL: 476 case ui::ET_GESTURE_TAP_CANCEL:
477 if (::switches::IsTouchFeedbackEnabled() && state_ != STATE_DISABLED) 477 if (::switches::IsTouchFeedbackEnabled() && state() != STATE_DISABLED)
478 SetState(STATE_NORMAL); 478 SetState(STATE_NORMAL);
479 break; 479 break;
480 case ui::ET_GESTURE_LONG_PRESS: 480 case ui::ET_GESTURE_LONG_PRESS:
481 if (!apps_grid_view_->has_dragged_view()) 481 if (!apps_grid_view_->has_dragged_view())
482 SetTouchDragging(true); 482 SetTouchDragging(true);
483 event->SetHandled(); 483 event->SetHandled();
484 break; 484 break;
485 case ui::ET_GESTURE_LONG_TAP: 485 case ui::ET_GESTURE_LONG_TAP:
486 case ui::ET_GESTURE_END: 486 case ui::ET_GESTURE_END:
487 if (touch_dragging_) 487 if (touch_dragging_)
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 SetItemPercentDownloaded(item_weak_->percent_downloaded()); 573 SetItemPercentDownloaded(item_weak_->percent_downloaded());
574 } 574 }
575 575
576 void AppListItemView::ItemBeingDestroyed() { 576 void AppListItemView::ItemBeingDestroyed() {
577 DCHECK(item_weak_); 577 DCHECK(item_weak_);
578 item_weak_->RemoveObserver(this); 578 item_weak_->RemoveObserver(this);
579 item_weak_ = NULL; 579 item_weak_ = NULL;
580 } 580 }
581 581
582 } // namespace app_list 582 } // namespace app_list
OLDNEW
« no previous file with comments | « mash/wm/frame/caption_buttons/frame_caption_button.cc ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698