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/search_result_view.h" | 5 #include "ui/app_list/views/search_result_view.h" |
6 | 6 |
7 #include "ui/app_list/app_list_constants.h" | 7 #include "ui/app_list/app_list_constants.h" |
8 #include "ui/app_list/search_result.h" | 8 #include "ui/app_list/search_result.h" |
9 #include "ui/app_list/views/search_result_list_view.h" | 9 #include "ui/app_list/views/search_result_list_view.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 views::ImageButton* button = action_buttons_[i]; | 283 views::ImageButton* button = action_buttons_[i]; |
284 button->SetImage(views::CustomButton::STATE_NORMAL, &icon.base_image); | 284 button->SetImage(views::CustomButton::STATE_NORMAL, &icon.base_image); |
285 button->SetImage(views::CustomButton::STATE_HOVERED, &icon.hover_image); | 285 button->SetImage(views::CustomButton::STATE_HOVERED, &icon.hover_image); |
286 button->SetImage(views::CustomButton::STATE_PRESSED, &icon.pressed_image); | 286 button->SetImage(views::CustomButton::STATE_PRESSED, &icon.pressed_image); |
287 button->SetTooltipText(icon.tooltip_text); | 287 button->SetTooltipText(icon.tooltip_text); |
288 } | 288 } |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 void SearchResultView::ShowContextMenuForView(views::View* source, | 292 void SearchResultView::ShowContextMenuForView(views::View* source, |
293 const gfx::Point& point) { | 293 const gfx::Point& point, |
| 294 ui::MenuSourceType source_type) { |
294 ui::MenuModel* menu_model = result_->GetContextMenuModel(); | 295 ui::MenuModel* menu_model = result_->GetContextMenuModel(); |
295 if (!menu_model) | 296 if (!menu_model) |
296 return; | 297 return; |
297 | 298 |
298 context_menu_runner_.reset(new views::MenuRunner(menu_model)); | 299 context_menu_runner_.reset(new views::MenuRunner(menu_model)); |
299 if (context_menu_runner_->RunMenuAt( | 300 if (context_menu_runner_->RunMenuAt( |
300 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 301 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
301 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == | 302 views::MenuItemView::TOPLEFT, source_type, |
| 303 views::MenuRunner::HAS_MNEMONICS) == |
302 views::MenuRunner::MENU_DELETED) | 304 views::MenuRunner::MENU_DELETED) |
303 return; | 305 return; |
304 } | 306 } |
305 | 307 |
306 } // namespace app_list | 308 } // namespace app_list |
OLD | NEW |