| 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_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const std::vector<int>& autofill_unique_ids() const { | 68 const std::vector<int>& autofill_unique_ids() const { |
| 69 return autofill_unique_ids_; | 69 return autofill_unique_ids_; |
| 70 } | 70 } |
| 71 int separator_index() const { return separator_index_; } | 71 int separator_index() const { return separator_index_; } |
| 72 | 72 |
| 73 int selected_line() const { return selected_line_; } | 73 int selected_line() const { return selected_line_; } |
| 74 | 74 |
| 75 // Change which line is currently selected by the user. | 75 // Change which line is currently selected by the user. |
| 76 void SetSelectedLine(int selected_line); | 76 void SetSelectedLine(int selected_line); |
| 77 | 77 |
| 78 // Increase the selected line by 1, properly handling wrapping. |
| 79 void SelectNextLine(); |
| 80 |
| 81 // Decrease the selected line by 1, properly handling wrapping. |
| 82 void SelectPreviousLine(); |
| 83 |
| 84 // The user has choosen the selected line. |
| 85 bool AcceptSelectedLine(); |
| 86 |
| 87 // The user has removed a suggestion. |
| 88 bool RemoveSelectedLine(); |
| 89 |
| 90 // Used to indicate that no line is currently selected by the user. |
| 91 const int kNoSelection = -1; |
| 92 |
| 78 private: | 93 private: |
| 79 // content::NotificationObserver method override. | 94 // content::NotificationObserver method override. |
| 80 virtual void Observe(int type, | 95 virtual void Observe(int type, |
| 81 const content::NotificationSource& source, | 96 const content::NotificationSource& source, |
| 82 const content::NotificationDetails& details) OVERRIDE; | 97 const content::NotificationDetails& details) OVERRIDE; |
| 83 | 98 |
| 84 // A scoped container for notification registries. | 99 // A scoped container for notification registries. |
| 85 content::NotificationRegistrar registrar_; | 100 content::NotificationRegistrar registrar_; |
| 86 | 101 |
| 87 AutofillExternalDelegate* external_delegate_; | 102 AutofillExternalDelegate* external_delegate_; |
| 88 | 103 |
| 89 // The bounds of the text element that is the focus of the Autofill. | 104 // The bounds of the text element that is the focus of the Autofill. |
| 90 gfx::Rect element_bounds_; | 105 gfx::Rect element_bounds_; |
| 91 | 106 |
| 92 // The current Autofill query values. | 107 // The current Autofill query values. |
| 93 std::vector<string16> autofill_values_; | 108 std::vector<string16> autofill_values_; |
| 94 std::vector<string16> autofill_labels_; | 109 std::vector<string16> autofill_labels_; |
| 95 std::vector<string16> autofill_icons_; | 110 std::vector<string16> autofill_icons_; |
| 96 std::vector<int> autofill_unique_ids_; | 111 std::vector<int> autofill_unique_ids_; |
| 97 | 112 |
| 98 // The location of the separator index (which separates the returned values | 113 // The location of the separator index (which separates the returned values |
| 99 // from the Autofill options). | 114 // from the Autofill options). |
| 100 int separator_index_; | 115 int separator_index_; |
| 101 | 116 |
| 102 // The line that is currently selected by the user. | 117 // The line that is currently selected by the user. |
| 103 // -1 indicates that no line is currently selected. | 118 // |kNoSelection| indicates that no line is currently selected. |
| 104 int selected_line_; | 119 int selected_line_; |
| 105 }; | 120 }; |
| 106 | 121 |
| 107 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ | 122 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_POPUP_VIEW_H_ |
| OLD | NEW |