| 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 #ifndef CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 | 13 |
| 14 class ChooserContentViewController; | 14 class ChooserContentViewController; |
| 15 class ChooserController; | 15 class ChooserController; |
| 16 @class SpinnerView; | 16 @class SpinnerView; |
| 17 | 17 |
| 18 // A chooser content view class that user can select an option. | 18 // A chooser content view class that user can select an option. |
| 19 @interface ChooserContentViewCocoa : NSView { | 19 @interface ChooserContentViewCocoa : NSView { |
| 20 @private | 20 @private |
| 21 base::scoped_nsobject<NSTextField> titleView_; | 21 base::scoped_nsobject<NSTextField> titleView_; |
| 22 base::scoped_nsobject<NSButton> adapterOffHelpButton_; |
| 22 base::scoped_nsobject<NSScrollView> scrollView_; | 23 base::scoped_nsobject<NSScrollView> scrollView_; |
| 23 base::scoped_nsobject<NSTableColumn> tableColumn_; | 24 base::scoped_nsobject<NSTableColumn> tableColumn_; |
| 24 base::scoped_nsobject<NSTableView> tableView_; | 25 base::scoped_nsobject<NSTableView> tableView_; |
| 25 base::scoped_nsobject<SpinnerView> spinner_; | 26 base::scoped_nsobject<SpinnerView> spinner_; |
| 26 base::scoped_nsobject<NSTextField> status_; | 27 base::scoped_nsobject<NSTextField> status_; |
| 27 base::scoped_nsobject<NSButton> rescanButton_; | 28 base::scoped_nsobject<NSButton> rescanButton_; |
| 28 base::scoped_nsobject<NSButton> connectButton_; | 29 base::scoped_nsobject<NSButton> connectButton_; |
| 29 base::scoped_nsobject<NSButton> cancelButton_; | 30 base::scoped_nsobject<NSButton> cancelButton_; |
| 30 base::scoped_nsobject<NSBox> separator_; | 31 base::scoped_nsobject<NSBox> separator_; |
| 31 base::scoped_nsobject<NSTextField> message_; | 32 base::scoped_nsobject<NSTextField> message_; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 // Calculates the origin for the "Connect" button. | 105 // Calculates the origin for the "Connect" button. |
| 105 - (NSPoint)calculateConnectButtonOrigin:(CGFloat)buttonRowHeight; | 106 - (NSPoint)calculateConnectButtonOrigin:(CGFloat)buttonRowHeight; |
| 106 | 107 |
| 107 // Calculates the origin for the "Cancel" button. | 108 // Calculates the origin for the "Cancel" button. |
| 108 - (NSPoint)calculateCancelButtonOrigin:(CGFloat)buttonRowHeight; | 109 - (NSPoint)calculateCancelButtonOrigin:(CGFloat)buttonRowHeight; |
| 109 | 110 |
| 110 // Updates the origin and size of the view. | 111 // Updates the origin and size of the view. |
| 111 - (void)updateView; | 112 - (void)updateView; |
| 112 | 113 |
| 114 // Gets the adapter off help button. |
| 115 - (NSButton*)adapterOffHelpButton; |
| 116 |
| 113 // Gets the table view for the chooser. | 117 // Gets the table view for the chooser. |
| 114 - (NSTableView*)tableView; | 118 - (NSTableView*)tableView; |
| 115 | 119 |
| 116 // Gets the spinner. | 120 // Gets the spinner. |
| 117 - (SpinnerView*)spinner; | 121 - (SpinnerView*)spinner; |
| 118 | 122 |
| 119 // Gets the status text field. | 123 // Gets the status text field. |
| 120 - (NSTextField*)status; | 124 - (NSTextField*)status; |
| 121 | 125 |
| 122 // Gets the "Re-scan" button. | 126 // Gets the "Re-scan" button. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 142 | 146 |
| 143 // Called when the "Connect" button is pressed. | 147 // Called when the "Connect" button is pressed. |
| 144 - (void)accept; | 148 - (void)accept; |
| 145 | 149 |
| 146 // Called when the "Cancel" button is pressed. | 150 // Called when the "Cancel" button is pressed. |
| 147 - (void)cancel; | 151 - (void)cancel; |
| 148 | 152 |
| 149 // Called when the chooser is closed. | 153 // Called when the chooser is closed. |
| 150 - (void)close; | 154 - (void)close; |
| 151 | 155 |
| 156 // Called when the adapter off help button is pressed. |
| 157 - (void)onAdapterOffHelp:(id)sender; |
| 158 |
| 152 // Called when "Re-scan" button is pressed. | 159 // Called when "Re-scan" button is pressed. |
| 153 - (void)onRescan:(id)sender; | 160 - (void)onRescan:(id)sender; |
| 154 | 161 |
| 155 // Called when the "Get help" button is pressed. | 162 // Called when the "Get help" button is pressed. |
| 156 - (void)onHelpPressed:(id)sender; | 163 - (void)onHelpPressed:(id)sender; |
| 157 | 164 |
| 158 // Update the color of the image and text in the table row view. | 165 // Update the color of the image and text in the table row view. |
| 159 - (void)updateContentRowColor; | 166 - (void)updateContentRowColor; |
| 160 | 167 |
| 161 // Gets the image from table row view. For testing and internal use only. | 168 // Gets the image from table row view. For testing and internal use only. |
| 162 - (NSImageView*)tableRowViewImage:(NSInteger)row; | 169 - (NSImageView*)tableRowViewImage:(NSInteger)row; |
| 163 | 170 |
| 164 // Gets the text from table row view. For testing and internal use only. | 171 // Gets the text from table row view. For testing and internal use only. |
| 165 - (NSTextField*)tableRowViewText:(NSInteger)row; | 172 - (NSTextField*)tableRowViewText:(NSInteger)row; |
| 166 | 173 |
| 167 // Gets the paired status from table row view. For testing and internal use | 174 // Gets the paired status from table row view. For testing and internal use |
| 168 // only. | 175 // only. |
| 169 - (NSTextField*)tableRowViewPairedStatus:(NSInteger)row; | 176 - (NSTextField*)tableRowViewPairedStatus:(NSInteger)row; |
| 170 | 177 |
| 171 @end | 178 @end |
| 172 | 179 |
| 173 #endif // CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ | 180 #endif // CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_ |
| OLD | NEW |