| 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_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const std::vector<base::string16>& subtexts, | 42 const std::vector<base::string16>& subtexts, |
| 43 const std::vector<base::string16>& icons, | 43 const std::vector<base::string16>& icons, |
| 44 const std::vector<int>& identifiers); | 44 const std::vector<int>& identifiers); |
| 45 | 45 |
| 46 // Updates the data list values currently shown with the popup. | 46 // Updates the data list values currently shown with the popup. |
| 47 void UpdateDataListValues(const std::vector<base::string16>& values, | 47 void UpdateDataListValues(const std::vector<base::string16>& values, |
| 48 const std::vector<base::string16>& labels); | 48 const std::vector<base::string16>& labels); |
| 49 | 49 |
| 50 // Hides the popup and destroys the controller. This also invalidates | 50 // Hides the popup and destroys the controller. This also invalidates |
| 51 // |delegate_|. | 51 // |delegate_|. |
| 52 virtual void Hide() OVERRIDE; | 52 virtual void Hide() override; |
| 53 | 53 |
| 54 // Invoked when the view was destroyed by by someone other than this class. | 54 // Invoked when the view was destroyed by by someone other than this class. |
| 55 virtual void ViewDestroyed() OVERRIDE; | 55 virtual void ViewDestroyed() override; |
| 56 | 56 |
| 57 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event); | 57 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event); |
| 58 | 58 |
| 59 // Tells the view to capture mouse events. Must be called before |Show()|. | 59 // Tells the view to capture mouse events. Must be called before |Show()|. |
| 60 void set_hide_on_outside_click(bool hide_on_outside_click); | 60 void set_hide_on_outside_click(bool hide_on_outside_click); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 FRIEND_TEST_ALL_PREFIXES(AutofillExternalDelegateBrowserTest, | 63 FRIEND_TEST_ALL_PREFIXES(AutofillExternalDelegateBrowserTest, |
| 64 CloseWidgetAndNoLeaking); | 64 CloseWidgetAndNoLeaking); |
| 65 FRIEND_TEST_ALL_PREFIXES(AutofillPopupControllerUnitTest, | 65 FRIEND_TEST_ALL_PREFIXES(AutofillPopupControllerUnitTest, |
| 66 ProperlyResetController); | 66 ProperlyResetController); |
| 67 | 67 |
| 68 AutofillPopupControllerImpl(base::WeakPtr<AutofillPopupDelegate> delegate, | 68 AutofillPopupControllerImpl(base::WeakPtr<AutofillPopupDelegate> delegate, |
| 69 content::WebContents* web_contents, | 69 content::WebContents* web_contents, |
| 70 gfx::NativeView container_view, | 70 gfx::NativeView container_view, |
| 71 const gfx::RectF& element_bounds, | 71 const gfx::RectF& element_bounds, |
| 72 base::i18n::TextDirection text_direction); | 72 base::i18n::TextDirection text_direction); |
| 73 virtual ~AutofillPopupControllerImpl(); | 73 virtual ~AutofillPopupControllerImpl(); |
| 74 | 74 |
| 75 // AutofillPopupController implementation. | 75 // AutofillPopupController implementation. |
| 76 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; | 76 virtual void UpdateBoundsAndRedrawPopup() override; |
| 77 virtual void SetSelectionAtPoint(const gfx::Point& point) OVERRIDE; | 77 virtual void SetSelectionAtPoint(const gfx::Point& point) override; |
| 78 virtual bool AcceptSelectedLine() OVERRIDE; | 78 virtual bool AcceptSelectedLine() override; |
| 79 virtual void SelectionCleared() OVERRIDE; | 79 virtual void SelectionCleared() override; |
| 80 virtual void AcceptSuggestion(size_t index) OVERRIDE; | 80 virtual void AcceptSuggestion(size_t index) override; |
| 81 virtual int GetIconResourceID( | 81 virtual int GetIconResourceID( |
| 82 const base::string16& resource_name) const OVERRIDE; | 82 const base::string16& resource_name) const override; |
| 83 virtual bool CanDelete(size_t index) const OVERRIDE; | 83 virtual bool CanDelete(size_t index) const override; |
| 84 virtual bool IsWarning(size_t index) const OVERRIDE; | 84 virtual bool IsWarning(size_t index) const override; |
| 85 virtual gfx::Rect GetRowBounds(size_t index) OVERRIDE; | 85 virtual gfx::Rect GetRowBounds(size_t index) override; |
| 86 virtual void SetPopupBounds(const gfx::Rect& bounds) OVERRIDE; | 86 virtual void SetPopupBounds(const gfx::Rect& bounds) override; |
| 87 virtual const gfx::Rect& popup_bounds() const OVERRIDE; | 87 virtual const gfx::Rect& popup_bounds() const override; |
| 88 virtual gfx::NativeView container_view() OVERRIDE; | 88 virtual gfx::NativeView container_view() override; |
| 89 virtual const gfx::RectF& element_bounds() const OVERRIDE; | 89 virtual const gfx::RectF& element_bounds() const override; |
| 90 virtual bool IsRTL() const OVERRIDE; | 90 virtual bool IsRTL() const override; |
| 91 | 91 |
| 92 virtual const std::vector<base::string16>& names() const OVERRIDE; | 92 virtual const std::vector<base::string16>& names() const override; |
| 93 virtual const std::vector<base::string16>& subtexts() const OVERRIDE; | 93 virtual const std::vector<base::string16>& subtexts() const override; |
| 94 virtual const std::vector<base::string16>& icons() const OVERRIDE; | 94 virtual const std::vector<base::string16>& icons() const override; |
| 95 virtual const std::vector<int>& identifiers() const OVERRIDE; | 95 virtual const std::vector<int>& identifiers() const override; |
| 96 #if !defined(OS_ANDROID) | 96 #if !defined(OS_ANDROID) |
| 97 virtual const gfx::FontList& GetNameFontListForRow( | 97 virtual const gfx::FontList& GetNameFontListForRow( |
| 98 size_t index) const OVERRIDE; | 98 size_t index) const override; |
| 99 virtual const gfx::FontList& subtext_font_list() const OVERRIDE; | 99 virtual const gfx::FontList& subtext_font_list() const override; |
| 100 #endif | 100 #endif |
| 101 virtual int selected_line() const OVERRIDE; | 101 virtual int selected_line() const override; |
| 102 | 102 |
| 103 content::WebContents* web_contents(); | 103 content::WebContents* web_contents(); |
| 104 | 104 |
| 105 // Change which line is currently selected by the user. | 105 // Change which line is currently selected by the user. |
| 106 void SetSelectedLine(int selected_line); | 106 void SetSelectedLine(int selected_line); |
| 107 | 107 |
| 108 // Increase the selected line by 1, properly handling wrapping. | 108 // Increase the selected line by 1, properly handling wrapping. |
| 109 void SelectNextLine(); | 109 void SelectNextLine(); |
| 110 | 110 |
| 111 // Decrease the selected line by 1, properly handling wrapping. | 111 // Decrease the selected line by 1, properly handling wrapping. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // The line that is currently selected by the user. | 199 // The line that is currently selected by the user. |
| 200 // |kNoSelection| indicates that no line is currently selected. | 200 // |kNoSelection| indicates that no line is currently selected. |
| 201 int selected_line_; | 201 int selected_line_; |
| 202 | 202 |
| 203 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; | 203 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 } // namespace autofill | 206 } // namespace autofill |
| 207 | 207 |
| 208 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 208 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| OLD | NEW |