Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4715)

Unified Diff: chrome/browser/autofill/autofill_popup_view.h

Issue 10073018: Add Delete Support to New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/autofill_popup_view.h
diff --git a/chrome/browser/autofill/autofill_popup_view.h b/chrome/browser/autofill/autofill_popup_view.h
index 6bf1321409d2ee4db3f7320302072efd739a38a6..7d1771d33c9a29be3ff7f406e8a35ba8700df4bd 100644
--- a/chrome/browser/autofill/autofill_popup_view.h
+++ b/chrome/browser/autofill/autofill_popup_view.h
@@ -34,8 +34,7 @@ class AutofillPopupView : public content::NotificationObserver {
void Show(const std::vector<string16>& autofill_values,
const std::vector<string16>& autofill_labels,
const std::vector<string16>& autofill_icons,
- const std::vector<int>& autofill_unique_ids,
- int separator_index);
+ const std::vector<int>& autofill_unique_ids);
void set_element_bounds(const gfx::Rect& bounds) {
element_bounds_ = bounds;
@@ -54,6 +53,9 @@ class AutofillPopupView : public content::NotificationObserver {
// Invalide the given row and redraw it.
virtual void InvalidateRow(size_t row) = 0;
+ // Adjust the size of the popup to show the elements being held.
+ virtual void ResizePopup() = 0;
+
AutofillExternalDelegate* external_delegate() { return external_delegate_; }
const std::vector<string16>& autofill_values() const {
@@ -68,7 +70,6 @@ class AutofillPopupView : public content::NotificationObserver {
const std::vector<int>& autofill_unique_ids() const {
return autofill_unique_ids_;
}
- int separator_index() const { return separator_index_; }
int selected_line() const { return selected_line_; }
@@ -87,7 +88,17 @@ class AutofillPopupView : public content::NotificationObserver {
// The user has removed a suggestion.
bool RemoveSelectedLine();
+ // Return true if the index is the first element of a new section and should
+ // have a separator above it.
+ bool IsSeparatorIndex(int index);
+
private:
+ // Returns true if the given id refers to an element that can be deleted.
+ bool CanDelete(int id);
+
+ // Returns true if the popup still has non-options entries to show the user.
+ bool HasAutofillEntries();
+
// content::NotificationObserver method override.
virtual void Observe(int type,
const content::NotificationSource& source,
@@ -107,10 +118,6 @@ class AutofillPopupView : public content::NotificationObserver {
std::vector<string16> autofill_icons_;
std::vector<int> autofill_unique_ids_;
- // The location of the separator index (which separates the returned values
- // from the Autofill options).
- int separator_index_;
-
// The line that is currently selected by the user.
// |kNoSelection| indicates that no line is currently selected.
int selected_line_;

Powered by Google App Engine
This is Rietveld 408576698