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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h

Issue 1099403005: [AiS] changing mac omnibox suggestions form NSMatrix to NSTableView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: autorelease on column data cell Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
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 0f6d41e47bc9bfe39af3a688c9df9839e3a34c35..476811b41871b3c2bee3240e867f70f035d74cd0 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h
@@ -10,6 +10,36 @@
#import "ui/base/cocoa/tracking_area.h"
#include "ui/base/window_open_disposition.h"
+class AutocompleteResult;
+@class OmniboxPopupCell;
+@class OmniboxPopupMatrix;
+class OmniboxPopupViewMac;
+
+@interface OmniboxPopupTableController
+ : NSViewController<NSTableViewDelegate, NSTableViewDataSource> {
+ @private
+ base::scoped_nsobject<NSArray> array_;
+ NSInteger hoveredIndex_;
+};
+
+// Setup the information used by the NSTableView data source.
+- (instancetype)initWithMatchResults:(const AutocompleteResult&)result
+ tableView:(OmniboxPopupMatrix*)tableView
+ popupView:(const OmniboxPopupViewMac&)popupView
+ answerImage:(NSImage*)answerImage;
+
+// Set the hovered highlight.
+- (void)setHighlightedRow:(NSInteger)rowIndex;
+
+// Which row has the hovered highlight.
+- (NSInteger)highlightedRow;
+
+@end
+
+@interface OmniboxPopupTableController (TestingAPI)
+- (instancetype)initWithArray:(NSArray*)array;
+@end
+
@class OmniboxPopupMatrix;
class OmniboxPopupMatrixObserver {
@@ -27,11 +57,19 @@ class OmniboxPopupMatrixObserver {
// Sets up a tracking area to implement hover by highlighting the cell the mouse
// is over.
-@interface OmniboxPopupMatrix : NSMatrix {
+@interface OmniboxPopupMatrix : NSTableView {
+ base::scoped_nsobject<OmniboxPopupTableController> matrixController_;
OmniboxPopupMatrixObserver* observer_; // weak
ui::ScopedCrTrackingArea trackingArea_;
+ NSAttributedString* separator_;
+
+ // The width of widest match contents in a set of infinite suggestions.
+ CGFloat maxMatchContentsWidth_;
}
+@property(retain, nonatomic) NSAttributedString* separator;
+@property(nonatomic) CGFloat maxMatchContentsWidth;
+
// Create a zero-size matrix.
- (instancetype)initWithObserver:(OmniboxPopupMatrixObserver*)observer;
@@ -41,6 +79,12 @@ class OmniboxPopupMatrixObserver {
// Return the currently highlighted row. Returns -1 if no row is highlighted.
- (NSInteger)highlightedRow;
+// Move the selection to |rowIndex|.
+- (void)selectRowIndex:(NSInteger)rowIndex;
+
+// Setup the NSTableView data source.
+- (void)setController:(OmniboxPopupTableController*)controller;
+
@end
#endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_MATRIX_H_

Powered by Google App Engine
This is Rietveld 408576698