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

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

Issue 2272023002: Turn AppList context menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « ui/app_list/views/app_list_menu_views.cc ('k') | ui/app_list/views/search_result_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_tile_item_view.h" 5 #include "ui/app_list/views/search_result_tile_item_view.h"
6 6
7 #include "ui/app_list/app_list_view_delegate.h" 7 #include "ui/app_list/app_list_view_delegate.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_container_view.h" 9 #include "ui/app_list/views/search_result_container_view.h"
10 #include "ui/views/controls/menu/menu_runner.h" 10 #include "ui/views/controls/menu/menu_runner.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (!item_) 93 if (!item_)
94 return; 94 return;
95 95
96 ui::MenuModel* menu_model = item_->GetContextMenuModel(); 96 ui::MenuModel* menu_model = item_->GetContextMenuModel();
97 if (!menu_model) 97 if (!menu_model)
98 return; 98 return;
99 99
100 if (!selected()) 100 if (!selected())
101 result_container_->ClearSelectedIndex(); 101 result_container_->ClearSelectedIndex();
102 102
103 context_menu_runner_.reset( 103 context_menu_runner_.reset(new views::MenuRunner(
104 new views::MenuRunner(menu_model, views::MenuRunner::HAS_MNEMONICS)); 104 menu_model, views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::ASYNC));
105 // If RunMenuAt() fails, return immediately. This is future-proofing for 105 context_menu_runner_->RunMenuAt(GetWidget(), nullptr,
106 // adding code after this call. 106 gfx::Rect(point, gfx::Size()),
107 if (context_menu_runner_->RunMenuAt( 107 views::MENU_ANCHOR_TOPLEFT, source_type);
108 GetWidget(), nullptr, gfx::Rect(point, gfx::Size()),
109 views::MENU_ANCHOR_TOPLEFT,
110 source_type) == views::MenuRunner::MENU_DELETED)
111 return;
112 } 108 }
113 109
114 } // namespace app_list 110 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_menu_views.cc ('k') | ui/app_list/views/search_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698