| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 15 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| 16 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" | 16 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" |
| 17 #include "chrome/browser/ui/autofill/popup_controller_common.h" | 17 #include "chrome/browser/ui/autofill/popup_controller_common.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/gfx/geometry/rect_f.h" | 19 #include "ui/gfx/geometry/rect_f.h" |
| 20 #include "ui/native_theme/native_theme.h" |
| 20 | 21 |
| 21 namespace autofill { | 22 namespace autofill { |
| 22 | 23 |
| 23 class AutofillPopupDelegate; | 24 class AutofillPopupDelegate; |
| 24 class AutofillPopupView; | 25 class AutofillPopupView; |
| 25 | 26 |
| 26 // This class is a controller for an AutofillPopupView. It implements | 27 // This class is a controller for an AutofillPopupView. It implements |
| 27 // AutofillPopupController to allow calls from AutofillPopupView. The | 28 // AutofillPopupController to allow calls from AutofillPopupView. The |
| 28 // other, public functions are available to its instantiator. | 29 // other, public functions are available to its instantiator. |
| 29 class AutofillPopupControllerImpl : public AutofillPopupController { | 30 class AutofillPopupControllerImpl : public AutofillPopupController { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 89 |
| 89 // AutofillPopupController implementation. | 90 // AutofillPopupController implementation. |
| 90 size_t GetLineCount() const override; | 91 size_t GetLineCount() const override; |
| 91 const autofill::Suggestion& GetSuggestionAt(size_t row) const override; | 92 const autofill::Suggestion& GetSuggestionAt(size_t row) const override; |
| 92 const base::string16& GetElidedValueAt(size_t row) const override; | 93 const base::string16& GetElidedValueAt(size_t row) const override; |
| 93 const base::string16& GetElidedLabelAt(size_t row) const override; | 94 const base::string16& GetElidedLabelAt(size_t row) const override; |
| 94 bool GetRemovalConfirmationText(int list_index, | 95 bool GetRemovalConfirmationText(int list_index, |
| 95 base::string16* title, | 96 base::string16* title, |
| 96 base::string16* body) override; | 97 base::string16* body) override; |
| 97 bool RemoveSuggestion(int list_index) override; | 98 bool RemoveSuggestion(int list_index) override; |
| 98 SkColor GetBackgroundColorForRow(int index) const override; | 99 ui::NativeTheme::ColorId GetBackgroundColorIDForRow(int index) const override; |
| 99 int selected_line() const override; | 100 int selected_line() const override; |
| 100 const AutofillPopupLayoutModel& layout_model() const override; | 101 const AutofillPopupLayoutModel& layout_model() const override; |
| 101 | 102 |
| 102 content::WebContents* web_contents(); | 103 content::WebContents* web_contents(); |
| 103 | 104 |
| 104 // Change which line is currently selected by the user. | 105 // Change which line is currently selected by the user. |
| 105 void SetSelectedLine(int selected_line); | 106 void SetSelectedLine(int selected_line); |
| 106 | 107 |
| 107 // Increase the selected line by 1, properly handling wrapping. | 108 // Increase the selected line by 1, properly handling wrapping. |
| 108 void SelectNextLine(); | 109 void SelectNextLine(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // The line that is currently selected by the user. | 168 // The line that is currently selected by the user. |
| 168 // |kNoSelection| indicates that no line is currently selected. | 169 // |kNoSelection| indicates that no line is currently selected. |
| 169 int selected_line_; | 170 int selected_line_; |
| 170 | 171 |
| 171 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; | 172 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace autofill | 175 } // namespace autofill |
| 175 | 176 |
| 176 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ | 177 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ |
| OLD | NEW |