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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_MATRIX_H_
6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_MATRIX_H_
8 #import <Cocoa/Cocoa.h>
10 #import "ui/base/cocoa/tracking_area.h"
11 #include "ui/base/window_open_disposition.h"
13 @
class OmniboxPopupMatrix
;
15 class OmniboxPopupMatrixDelegate
{
17 // Called when the selection in the matrix changes.
18 virtual void OnMatrixRowSelected(OmniboxPopupMatrix
* matrix
, size_t row
) = 0;
20 // Called when the user clicks on a row.
21 virtual void OnMatrixRowClicked(OmniboxPopupMatrix
* matrix
, size_t row
) = 0;
23 // Called when the user middle clicks on a row.
24 virtual void OnMatrixRowMiddleClicked(OmniboxPopupMatrix
* matrix
,
28 // Sets up a tracking area to implement hover by highlighting the cell the mouse
30 @interface OmniboxPopupMatrix
: NSMatrix
{
31 OmniboxPopupMatrixDelegate
* delegate_
; // weak
32 ui::ScopedCrTrackingArea trackingArea_
;
35 // Create a zero-size matrix.
36 - (id
)initWithDelegate
:(OmniboxPopupMatrixDelegate
*)delegate
;
39 - (void)setDelegate
:(OmniboxPopupMatrixDelegate
*)delegate
;
41 // Return the currently highlighted row. Returns -1 if no row is highlighted.
42 - (NSInteger
)highlightedRow
;
46 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_MATRIX_H_