| Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
|
| diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
|
| index 2ce61674c6b3890e773de072237ebebe06a5aae6..7d76037a07c48b7bf20e03f06259824f87574fba 100644
|
| --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
|
| +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
|
| @@ -10,37 +10,62 @@
|
| #import "ui/base/cocoa/tracking_area.h"
|
| #include "ui/base/window_open_disposition.h"
|
|
|
| -@class OmniboxPopupMatrix;
|
| +@class OmniboxPopupCell;
|
|
|
| -class OmniboxPopupMatrixDelegate {
|
| +@interface OmniboxPopupTableController
|
| + : NSViewController<NSTableViewDelegate, NSTableViewDataSource> {
|
| + @private
|
| + NSMutableArray* array_;
|
| +};
|
| +
|
| +// Allocate or free cells so that count are available.
|
| +// Also sets up default settings such as selecting the first cell.
|
| +- (void)setCellCount:(NSInteger)count;
|
| +
|
| +// Get an immutable version of the array.
|
| +- (NSArray*)getCellArray;
|
| +
|
| +@end
|
| +
|
| +@class OmniboxPopupTableView;
|
| +
|
| +class OmniboxPopupTableDelegate {
|
| public:
|
| - // Called when the selection in the matrix changes.
|
| - virtual void OnMatrixRowSelected(OmniboxPopupMatrix* matrix, size_t row) = 0;
|
| + // Called when the selection in the table changes.
|
| + virtual void OnTableRowSelected(OmniboxPopupTableView* table_view,
|
| + size_t row) = 0;
|
|
|
| // Called when the user clicks on a row.
|
| - virtual void OnMatrixRowClicked(OmniboxPopupMatrix* matrix, size_t row) = 0;
|
| + virtual void OnTableRowClicked(OmniboxPopupTableView* table_view,
|
| + size_t row) = 0;
|
|
|
| // Called when the user middle clicks on a row.
|
| - virtual void OnMatrixRowMiddleClicked(OmniboxPopupMatrix* matrix,
|
| - size_t row) = 0;
|
| + virtual void OnTableRowMiddleClicked(OmniboxPopupTableView* table_view,
|
| + size_t row) = 0;
|
| };
|
|
|
| -// Sets up a tracking area to implement hover by highlighting the cell the mouse
|
| -// is over.
|
| -@interface OmniboxPopupMatrix : NSMatrix {
|
| - OmniboxPopupMatrixDelegate* delegate_; // weak
|
| +@interface OmniboxPopupTableView : NSTableView {
|
| + OmniboxPopupTableDelegate* delegate_; // weak
|
| ui::ScopedCrTrackingArea trackingArea_;
|
| + OmniboxPopupTableController* controller_;
|
| }
|
|
|
| -// Create a zero-size matrix.
|
| -- (id)initWithDelegate:(OmniboxPopupMatrixDelegate*)delegate;
|
| +// Create a zero-size table.
|
| +- (id)initWithDelegate:(OmniboxPopupTableDelegate*)delegate;
|
|
|
| // Sets the delegate.
|
| -- (void)setDelegate:(OmniboxPopupMatrixDelegate*)delegate;
|
| +- (void)setCppDelegate:(OmniboxPopupTableDelegate*)delegate;
|
|
|
| // Return the currently highlighted row. Returns -1 if no row is highlighted.
|
| - (NSInteger)highlightedRow;
|
|
|
| +// Allocate or free cells so that count are available.
|
| +// Also sets up default settings such as selecting the first cell.
|
| +- (void)setCellCount:(NSInteger)count;
|
| +
|
| +// Fetch a cell with limit checks on the array.
|
| +- (OmniboxPopupCell*)cellAtRow:(NSInteger)row;
|
| +
|
| @end
|
|
|
| #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_MATRIX_H_
|
|
|