| OLD | NEW |
| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 gfx::Rect rect(GetContentsBounds()); | 274 gfx::Rect rect(GetContentsBounds()); |
| 275 if (apps_grid_view_->IsSelectedView(this)) | 275 if (apps_grid_view_->IsSelectedView(this)) |
| 276 canvas->FillRect(rect, kSelectedColor); | 276 canvas->FillRect(rect, kSelectedColor); |
| 277 | 277 |
| 278 if (ui_state_ == UI_STATE_DROPPING_IN_FOLDER) { | 278 if (ui_state_ == UI_STATE_DROPPING_IN_FOLDER) { |
| 279 DCHECK(apps_grid_view_->model()->folders_enabled()); | 279 DCHECK(apps_grid_view_->model()->folders_enabled()); |
| 280 | 280 |
| 281 // Draw folder dropping preview circle. | 281 // Draw folder dropping preview circle. |
| 282 gfx::Point center = gfx::Point(icon_->x() + icon_->size().width() / 2, | 282 gfx::Point center = gfx::Point(icon_->x() + icon_->size().width() / 2, |
| 283 icon_->y() + icon_->size().height() / 2); | 283 icon_->y() + icon_->size().height() / 2); |
| 284 SkPaint paint; | 284 cc::PaintFlags flags; |
| 285 paint.setStyle(SkPaint::kFill_Style); | 285 flags.setStyle(cc::PaintFlags::kFill_Style); |
| 286 paint.setAntiAlias(true); | 286 flags.setAntiAlias(true); |
| 287 paint.setColor(kFolderBubbleColor); | 287 flags.setColor(kFolderBubbleColor); |
| 288 canvas->DrawCircle(center, kFolderPreviewRadius, paint); | 288 canvas->DrawCircle(center, kFolderPreviewRadius, flags); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 void AppListItemView::ShowContextMenuForView(views::View* source, | 292 void AppListItemView::ShowContextMenuForView(views::View* source, |
| 293 const gfx::Point& point, | 293 const gfx::Point& point, |
| 294 ui::MenuSourceType source_type) { | 294 ui::MenuSourceType source_type) { |
| 295 ui::MenuModel* menu_model = | 295 ui::MenuModel* menu_model = |
| 296 item_weak_ ? item_weak_->GetContextMenuModel() : NULL; | 296 item_weak_ ? item_weak_->GetContextMenuModel() : NULL; |
| 297 if (!menu_model) | 297 if (!menu_model) |
| 298 return; | 298 return; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |