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

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

Issue 250943008: Move enum MenuAnchorPosition to reduce deps on menu_item_view.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 6 years, 7 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/app_list/app_list_constants.h" 9 #include "ui/app_list/app_list_constants.h"
10 #include "ui/app_list/search_result.h" 10 #include "ui/app_list/search_result.h"
11 #include "ui/app_list/views/progress_bar_view.h" 11 #include "ui/app_list/views/progress_bar_view.h"
12 #include "ui/app_list/views/search_result_actions_view.h" 12 #include "ui/app_list/views/search_result_actions_view.h"
13 #include "ui/app_list/views/search_result_list_view.h" 13 #include "ui/app_list/views/search_result_list_view.h"
14 #include "ui/gfx/canvas.h" 14 #include "ui/gfx/canvas.h"
15 #include "ui/gfx/font.h" 15 #include "ui/gfx/font.h"
16 #include "ui/gfx/image/image_skia_operations.h" 16 #include "ui/gfx/image/image_skia_operations.h"
17 #include "ui/gfx/render_text.h" 17 #include "ui/gfx/render_text.h"
18 #include "ui/views/controls/button/image_button.h" 18 #include "ui/views/controls/button/image_button.h"
19 #include "ui/views/controls/image_view.h" 19 #include "ui/views/controls/image_view.h"
20 #include "ui/views/controls/menu/menu_item_view.h"
21 #include "ui/views/controls/menu/menu_runner.h" 20 #include "ui/views/controls/menu/menu_runner.h"
22 21
23 namespace app_list { 22 namespace app_list {
24 23
25 namespace { 24 namespace {
26 25
27 const int kPreferredWidth = 300; 26 const int kPreferredWidth = 300;
28 const int kPreferredHeight = 52; 27 const int kPreferredHeight = 52;
29 const int kIconDimension = 32; 28 const int kIconDimension = 32;
30 const int kIconPadding = 14; 29 const int kIconPadding = 14;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 ui::MenuSourceType source_type) { 335 ui::MenuSourceType source_type) {
337 // |result_| could be NULL when result list is changing. 336 // |result_| could be NULL when result list is changing.
338 if (!result_) 337 if (!result_)
339 return; 338 return;
340 339
341 ui::MenuModel* menu_model = result_->GetContextMenuModel(); 340 ui::MenuModel* menu_model = result_->GetContextMenuModel();
342 if (!menu_model) 341 if (!menu_model)
343 return; 342 return;
344 343
345 context_menu_runner_.reset(new views::MenuRunner(menu_model)); 344 context_menu_runner_.reset(new views::MenuRunner(menu_model));
346 if (context_menu_runner_->RunMenuAt( 345 if (context_menu_runner_->RunMenuAt(GetWidget(),
347 GetWidget(), NULL, gfx::Rect(point, gfx::Size()), 346 NULL,
348 views::MenuItemView::TOPLEFT, source_type, 347 gfx::Rect(point, gfx::Size()),
349 views::MenuRunner::HAS_MNEMONICS) == 348 views::MENU_ANCHOR_TOPLEFT,
349 source_type,
350 views::MenuRunner::HAS_MNEMONICS) ==
350 views::MenuRunner::MENU_DELETED) 351 views::MenuRunner::MENU_DELETED)
351 return; 352 return;
352 } 353 }
353 354
354 } // namespace app_list 355 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_menu_views.cc ('k') | ui/message_center/views/message_view_context_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698