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

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

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698