| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" | 15 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" |
| 15 #include "components/omnibox/browser/autocomplete_match.h" | 16 #include "components/omnibox/browser/autocomplete_match.h" |
| 16 #include "components/omnibox/browser/omnibox_popup_view.h" | 17 #include "components/omnibox/browser/omnibox_popup_view.h" |
| 17 #include "ui/gfx/font.h" | 18 #include "ui/gfx/font.h" |
| 18 | 19 |
| 19 class AutocompleteResult; | 20 class AutocompleteResult; |
| 20 class OmniboxEditModel; | 21 class OmniboxEditModel; |
| 21 class OmniboxPopupModel; | 22 class OmniboxPopupModel; |
| 22 class OmniboxView; | 23 class OmniboxView; |
| 23 | 24 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // height, and makes the popup visible. Animates to the new frame | 68 // height, and makes the popup visible. Animates to the new frame |
| 68 // if the popup shrinks, snaps to the new frame if the popup grows, | 69 // if the popup shrinks, snaps to the new frame if the popup grows, |
| 69 // allows existing animations to continue if the size doesn't | 70 // allows existing animations to continue if the size doesn't |
| 70 // change. | 71 // change. |
| 71 void PositionPopup(const CGFloat matrixHeight); | 72 void PositionPopup(const CGFloat matrixHeight); |
| 72 | 73 |
| 73 // Opens the URL at the given row. | 74 // Opens the URL at the given row. |
| 74 void OpenURLForRow(size_t row, WindowOpenDisposition disposition); | 75 void OpenURLForRow(size_t row, WindowOpenDisposition disposition); |
| 75 | 76 |
| 76 OmniboxView* omnibox_view_; | 77 OmniboxView* omnibox_view_; |
| 77 scoped_ptr<OmniboxPopupModel> model_; | 78 std::unique_ptr<OmniboxPopupModel> model_; |
| 78 NSTextField* field_; // owned by tab controller | 79 NSTextField* field_; // owned by tab controller |
| 79 | 80 |
| 80 // Child window containing a matrix which implements the popup. | 81 // Child window containing a matrix which implements the popup. |
| 81 base::scoped_nsobject<NSWindow> popup_; | 82 base::scoped_nsobject<NSWindow> popup_; |
| 82 NSRect target_popup_frame_; | 83 NSRect target_popup_frame_; |
| 83 | 84 |
| 84 base::scoped_nsobject<OmniboxPopupMatrix> matrix_; | 85 base::scoped_nsobject<OmniboxPopupMatrix> matrix_; |
| 85 base::scoped_nsobject<NSView> top_separator_view_; | 86 base::scoped_nsobject<NSView> top_separator_view_; |
| 86 base::scoped_nsobject<NSView> bottom_separator_view_; | 87 base::scoped_nsobject<NSView> bottom_separator_view_; |
| 87 base::scoped_nsobject<NSBox> background_view_; | 88 base::scoped_nsobject<NSBox> background_view_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); | 90 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 93 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| OLD | NEW |