| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 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" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 // Cancel button. | 561 // Cancel button. |
| 562 CGFloat cancelButtonOriginX = kChooserWidth - kMarginX - cancelButtonWidth; | 562 CGFloat cancelButtonOriginX = kChooserWidth - kMarginX - cancelButtonWidth; |
| 563 CGFloat cancelButtonOriginY = connectButtonOriginY; | 563 CGFloat cancelButtonOriginY = connectButtonOriginY; |
| 564 [cancelButton_ | 564 [cancelButton_ |
| 565 setFrameOrigin:NSMakePoint(cancelButtonOriginX, cancelButtonOriginY)]; | 565 setFrameOrigin:NSMakePoint(cancelButtonOriginX, cancelButtonOriginY)]; |
| 566 [self addSubview:cancelButton_]; | 566 [self addSubview:cancelButton_]; |
| 567 | 567 |
| 568 // Separator. | 568 // Separator. |
| 569 CGFloat separatorOriginX = 0.0f; | 569 CGFloat separatorOriginX = 0.0f; |
| 570 CGFloat separatorOriginY = kMarginY + helpButtonHeight + kVerticalPadding; | 570 separatorOriginY_ = kMarginY + helpButtonHeight + kVerticalPadding; |
| 571 [separator_ setFrameOrigin:NSMakePoint(separatorOriginX, separatorOriginY)]; | 571 [separator_ |
| 572 setFrameOrigin:NSMakePoint(separatorOriginX, separatorOriginY_)]; |
| 572 [self addSubview:separator_]; | 573 [self addSubview:separator_]; |
| 573 | 574 |
| 574 // Help button. | 575 // Help button. |
| 575 CGFloat helpButtonOriginX = kMarginX; | 576 CGFloat helpButtonOriginX = kMarginX; |
| 576 CGFloat helpButtonOriginY = (kVerticalPadding + kMarginY) / 2; | 577 CGFloat helpButtonOriginY = (kVerticalPadding + kMarginY) / 2; |
| 577 [helpButton_ | 578 [helpButton_ |
| 578 setFrameOrigin:NSMakePoint(helpButtonOriginX, helpButtonOriginY)]; | 579 setFrameOrigin:NSMakePoint(helpButtonOriginX, helpButtonOriginY)]; |
| 579 [helpButton_ setTarget:self]; | 580 [helpButton_ setTarget:self]; |
| 580 [helpButton_ setAction:@selector(onHelpPressed:)]; | 581 [helpButton_ setAction:@selector(onHelpPressed:)]; |
| 581 [self addSubview:helpButton_]; | 582 [self addSubview:helpButton_]; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 [tableView_ viewAtColumn:0 row:row makeIfNecessary:YES]; | 872 [tableView_ viewAtColumn:0 row:row makeIfNecessary:YES]; |
| 872 return [tableRowView text]; | 873 return [tableRowView text]; |
| 873 } | 874 } |
| 874 | 875 |
| 875 - (NSTextField*)tableRowViewPairedStatus:(NSInteger)row { | 876 - (NSTextField*)tableRowViewPairedStatus:(NSInteger)row { |
| 876 ChooserContentTableRowView* tableRowView = | 877 ChooserContentTableRowView* tableRowView = |
| 877 [tableView_ viewAtColumn:0 row:row makeIfNecessary:YES]; | 878 [tableView_ viewAtColumn:0 row:row makeIfNecessary:YES]; |
| 878 return [tableRowView pairedStatus]; | 879 return [tableRowView pairedStatus]; |
| 879 } | 880 } |
| 880 | 881 |
| 882 - (void)drawRect:(NSRect)rect { |
| 883 [[NSColor colorWithCalibratedWhite:245.0f / 255.0f alpha:1.0f] setFill]; |
| 884 NSRect footnoteFrame = |
| 885 NSMakeRect(0.0f, 0.0f, kChooserWidth, separatorOriginY_); |
| 886 NSRectFill(footnoteFrame); |
| 887 [super drawRect:footnoteFrame]; |
| 888 } |
| 889 |
| 881 @end | 890 @end |
| OLD | NEW |