| 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_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/optional.h" |
| 15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 16 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| 16 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h" | 17 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h" |
| 18 #include "ui/accessibility/ax_enums.h" |
| 17 | 19 |
| 18 @class AutofillPopupViewCocoa; | 20 @class AutofillPopupViewCocoa; |
| 19 @class NSWindow; | 21 @class NSWindow; |
| 20 | 22 |
| 21 namespace autofill { | 23 namespace autofill { |
| 22 | 24 |
| 23 class AutofillPopupViewCocoaDelegate { | 25 class AutofillPopupViewCocoaDelegate { |
| 24 public: | 26 public: |
| 25 // Returns the bounds of the item at |index| in the popup, relative to | 27 // Returns the bounds of the item at |index| in the popup, relative to |
| 26 // the top left of the popup. | 28 // the top left of the popup. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 42 // AutofillPopupViewCocoaDelegate implementation. | 44 // AutofillPopupViewCocoaDelegate implementation. |
| 43 gfx::Rect GetRowBounds(size_t index) override; | 45 gfx::Rect GetRowBounds(size_t index) override; |
| 44 int GetIconResourceID(const base::string16& resource_name) override; | 46 int GetIconResourceID(const base::string16& resource_name) override; |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 ~AutofillPopupViewBridge() override; | 49 ~AutofillPopupViewBridge() override; |
| 48 | 50 |
| 49 // AutofillPopupView implementation. | 51 // AutofillPopupView implementation. |
| 50 void Hide() override; | 52 void Hide() override; |
| 51 void Show() override; | 53 void Show() override; |
| 52 void InvalidateRow(size_t row) override; | 54 void OnSelectedRowChanged( |
| 53 void UpdateBoundsAndRedrawPopup() override; | 55 base::Optional<size_t> previous_row_selection, |
| 56 base::Optional<size_t> current_row_selection) override; |
| 57 void OnSuggestionsChanged() override; |
| 54 | 58 |
| 55 // Set the initial bounds of the popup, including its placement. | 59 // Set the initial bounds of the popup, including its placement. |
| 56 void SetInitialBounds(); | 60 void SetInitialBounds(); |
| 57 | 61 |
| 58 // The native Cocoa view. | 62 // The native Cocoa view. |
| 59 base::scoped_nsobject<AutofillPopupViewCocoa> view_; | 63 base::scoped_nsobject<AutofillPopupViewCocoa> view_; |
| 60 | 64 |
| 61 AutofillPopupController* controller_; // Weak. | 65 AutofillPopupController* controller_; // Weak. |
| 62 | 66 |
| 63 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewBridge); | 67 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewBridge); |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace autofill | 70 } // namespace autofill |
| 67 | 71 |
| 68 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ | 72 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_ |
| OLD | NEW |