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

Side by Side Diff: ui/app_list/cocoa/apps_search_box_controller.mm

Issue 1777653002: Prepare ui/ module for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More compile errors. Created 4 years, 9 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 | « no previous file | ui/base/cocoa/cocoa_base_utils.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "ui/app_list/cocoa/apps_search_box_controller.h" 5 #import "ui/app_list/cocoa/apps_search_box_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
11 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect .h" 11 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect .h"
12 #include "ui/app_list/app_list_menu.h" 12 #include "ui/app_list/app_list_menu.h"
13 #include "ui/app_list/app_list_model.h" 13 #include "ui/app_list/app_list_model.h"
14 #include "ui/app_list/resources/grit/app_list_resources.h" 14 #include "ui/app_list/resources/grit/app_list_resources.h"
15 #include "ui/app_list/search_box_model.h" 15 #include "ui/app_list/search_box_model.h"
16 #include "ui/app_list/search_box_model_observer.h" 16 #include "ui/app_list/search_box_model_observer.h"
17 #include "ui/base/cocoa/cocoa_base_utils.h"
17 #import "ui/base/cocoa/controls/hover_image_menu_button.h" 18 #import "ui/base/cocoa/controls/hover_image_menu_button.h"
18 #import "ui/base/cocoa/controls/hover_image_menu_button_cell.h" 19 #import "ui/base/cocoa/controls/hover_image_menu_button_cell.h"
19 #import "ui/base/cocoa/menu_controller.h" 20 #import "ui/base/cocoa/menu_controller.h"
20 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/gfx/image/image_skia_util_mac.h" 22 #include "ui/gfx/image/image_skia_util_mac.h"
22 23
23 namespace { 24 namespace {
24 25
25 // Padding either side of the search icon and menu button. 26 // Padding either side of the search icon and menu button.
26 const CGFloat kPadding = 14; 27 const CGFloat kPadding = 14;
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 return self; 383 return self;
383 } 384 }
384 385
385 - (NSRect)confinementRectForMenu:(NSMenu*)menu 386 - (NSRect)confinementRectForMenu:(NSMenu*)menu
386 onScreen:(NSScreen*)screen { 387 onScreen:(NSScreen*)screen {
387 NSPopUpButton* menuButton = [searchBoxController_ menuControl]; 388 NSPopUpButton* menuButton = [searchBoxController_ menuControl];
388 // Ensure the menu comes up below the menu button by trimming the window frame 389 // Ensure the menu comes up below the menu button by trimming the window frame
389 // to a point anchored below the bottom right of the button. 390 // to a point anchored below the bottom right of the button.
390 NSRect anchorRect = [menuButton convertRect:[menuButton bounds] 391 NSRect anchorRect = [menuButton convertRect:[menuButton bounds]
391 toView:nil]; 392 toView:nil];
392 NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( 393 NSPoint anchorPoint = ui::ConvertPointFromWindowToScreen(
393 NSMaxX(anchorRect) + kMenuXOffsetFromButton, 394 [menuButton window],
394 NSMinY(anchorRect) - kMenuYOffsetFromButton)]; 395 NSMakePoint(NSMaxX(anchorRect) + kMenuXOffsetFromButton,
396 NSMinY(anchorRect) - kMenuYOffsetFromButton));
397
395 NSRect confinementRect = [[menuButton window] frame]; 398 NSRect confinementRect = [[menuButton window] frame];
396 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect), 399 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect),
397 anchorPoint.y - NSMinY(confinementRect)); 400 anchorPoint.y - NSMinY(confinementRect));
398 return confinementRect; 401 return confinementRect;
399 } 402 }
400 403
401 @end 404 @end
OLDNEW
« no previous file with comments | « no previous file | ui/base/cocoa/cocoa_base_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698