| 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 "ash/app_list/app_list_item_view.h" | 5 #include "ash/app_list/app_list_item_view.h" |
| 6 | 6 |
| 7 #include "ash/app_list/app_list_item_model.h" | 7 #include "ash/app_list/app_list_item_model.h" |
| 8 #include "ash/app_list/drop_shadow_label.h" | 8 #include "ash/app_list/drop_shadow_label.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 gfx::Rect rect(GetContentsBounds()); | 121 gfx::Rect rect(GetContentsBounds()); |
| 122 if (hover_animation_->is_animating()) { | 122 if (hover_animation_->is_animating()) { |
| 123 int alpha = SkColorGetA(kHoverColor) * hover_animation_->GetCurrentValue(); | 123 int alpha = SkColorGetA(kHoverColor) * hover_animation_->GetCurrentValue(); |
| 124 canvas->FillRect(rect, SkColorSetA(kHoverColor, alpha)); | 124 canvas->FillRect(rect, SkColorSetA(kHoverColor, alpha)); |
| 125 } else if (state() == BS_HOT) { | 125 } else if (state() == BS_HOT) { |
| 126 canvas->FillRect(rect, kHoverColor); | 126 canvas->FillRect(rect, kHoverColor); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 void AppListItemView::ShowContextMenuForView(views::View* source, | 130 void AppListItemView::ShowContextMenuForView(views::View* source, |
| 131 const gfx::Point& p, | 131 const gfx::Point& point) { |
| 132 bool is_mouse_gesture) { | |
| 133 ui::MenuModel* menu_model = model_->GetContextMenuModel(); | 132 ui::MenuModel* menu_model = model_->GetContextMenuModel(); |
| 134 if (!menu_model) | 133 if (!menu_model) |
| 135 return; | 134 return; |
| 136 | 135 |
| 137 views::MenuModelAdapter menu_adapter(menu_model); | 136 views::MenuModelAdapter menu_adapter(menu_model); |
| 138 context_menu_runner_.reset( | 137 context_menu_runner_.reset( |
| 139 new views::MenuRunner(new views::MenuItemView(&menu_adapter))); | 138 new views::MenuRunner(new views::MenuItemView(&menu_adapter))); |
| 140 menu_adapter.BuildMenu(context_menu_runner_->GetMenu()); | 139 menu_adapter.BuildMenu(context_menu_runner_->GetMenu()); |
| 141 if (context_menu_runner_->RunMenuAt( | 140 if (context_menu_runner_->RunMenuAt( |
| 142 GetWidget(), NULL, gfx::Rect(p, gfx::Size()), | 141 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 143 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == | 142 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == |
| 144 views::MenuRunner::MENU_DELETED) | 143 views::MenuRunner::MENU_DELETED) |
| 145 return; | 144 return; |
| 146 } | 145 } |
| 147 | 146 |
| 148 } // namespace ash | 147 } // namespace ash |
| OLD | NEW |