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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 const SearchResult::ActionIconSet& icon = icons.at(i); | 288 const SearchResult::ActionIconSet& icon = icons.at(i); |
289 views::ImageButton* button = action_buttons_[i]; | 289 views::ImageButton* button = action_buttons_[i]; |
290 button->SetImage(views::CustomButton::STATE_NORMAL, &icon.base_image); | 290 button->SetImage(views::CustomButton::STATE_NORMAL, &icon.base_image); |
291 button->SetImage(views::CustomButton::STATE_HOVERED, &icon.hover_image); | 291 button->SetImage(views::CustomButton::STATE_HOVERED, &icon.hover_image); |
292 button->SetImage(views::CustomButton::STATE_PRESSED, &icon.pressed_image); | 292 button->SetImage(views::CustomButton::STATE_PRESSED, &icon.pressed_image); |
293 button->SetTooltipText(icon.tooltip_text); | 293 button->SetTooltipText(icon.tooltip_text); |
294 } | 294 } |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 void SearchResultView::ShowContextMenuForView(views::View* source, | 298 void SearchResultView::ShowContextMenuForView( |
299 const gfx::Point& point) { | 299 views::View* source, |
| 300 const gfx::Point& point, |
| 301 ui::ContextMenuSourceType source_type) { |
300 ui::MenuModel* menu_model = result_->GetContextMenuModel(); | 302 ui::MenuModel* menu_model = result_->GetContextMenuModel(); |
301 if (!menu_model) | 303 if (!menu_model) |
302 return; | 304 return; |
303 | 305 |
304 context_menu_runner_.reset(new views::MenuRunner(menu_model)); | 306 context_menu_runner_.reset(new views::MenuRunner(menu_model)); |
305 if (context_menu_runner_->RunMenuAt( | 307 if (context_menu_runner_->RunContextMenuAt( |
306 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 308 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
307 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == | 309 source_type, views::MenuRunner::HAS_MNEMONICS) == |
308 views::MenuRunner::MENU_DELETED) | 310 views::MenuRunner::MENU_DELETED) |
309 return; | 311 return; |
310 } | 312 } |
311 | 313 |
312 } // namespace app_list | 314 } // namespace app_list |
OLD | NEW |