Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| index 9d7fae9677fdb33a8c5db2dca4f8baa0376198b1..dd062e4cb89d724fabdf6cc7c28a98ae783d4cdf 100644 |
| --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| @@ -12,9 +12,9 @@ |
| #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| #include "chrome/browser/ui/autofill/popup_constants.h" |
| #include "components/autofill/core/browser/autofill_popup_delegate.h" |
| +#include "components/autofill/core/common/autofill_enums.h" |
| #include "content/public/browser/native_web_keyboard_event.h" |
| #include "grit/webkit_resources.h" |
| -#include "third_party/WebKit/public/web/WebAutofillClient.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/events/event.h" |
| #include "ui/gfx/rect_conversions.h" |
| @@ -24,7 +24,6 @@ |
| #include "ui/gfx/vector2d.h" |
| using base::WeakPtr; |
| -using blink::WebAutofillClient; |
| namespace autofill { |
| namespace { |
| @@ -189,7 +188,7 @@ void AutofillPopupControllerImpl::UpdateDataListValues( |
| // Remove all the old data list values, which should always be at the top of |
| // the list if they are present. |
| while (!identifiers_.empty() && |
| - identifiers_[0] == WebAutofillClient::MenuItemIDDataListEntry) { |
| + identifiers_[0] == MenuItemIDDataListEntry) { |
|
Ilya Sherman
2014/02/11 22:21:33
nit: Looks like this line no longer needs to wrap.
gnana
2014/02/12 13:34:09
Done.
|
| names_.erase(names_.begin()); |
| subtexts_.erase(subtexts_.begin()); |
| icons_.erase(icons_.begin()); |
| @@ -200,7 +199,7 @@ void AutofillPopupControllerImpl::UpdateDataListValues( |
| // is one). |
| if (values.empty()) { |
| if (!identifiers_.empty() && |
| - identifiers_[0] == WebAutofillClient::MenuItemIDSeparator) { |
| + identifiers_[0] == MenuItemIDSeparator) { |
|
Ilya Sherman
2014/02/11 22:21:33
nit: Looks like this line no longer needs to wrap.
gnana
2014/02/12 13:34:09
Done.
|
| names_.erase(names_.begin()); |
| subtexts_.erase(subtexts_.begin()); |
| icons_.erase(icons_.begin()); |
| @@ -218,12 +217,11 @@ void AutofillPopupControllerImpl::UpdateDataListValues( |
| // Add a separator if there are any other values. |
| if (!identifiers_.empty() && |
| - identifiers_[0] != WebAutofillClient::MenuItemIDSeparator) { |
| + identifiers_[0] != MenuItemIDSeparator) { |
|
Ilya Sherman
2014/02/11 22:21:33
nit: Looks like this line no longer needs to wrap.
gnana
2014/02/12 13:34:09
Done.
|
| names_.insert(names_.begin(), base::string16()); |
| subtexts_.insert(subtexts_.begin(), base::string16()); |
| icons_.insert(icons_.begin(), base::string16()); |
| - identifiers_.insert(identifiers_.begin(), |
| - WebAutofillClient::MenuItemIDSeparator); |
| + identifiers_.insert(identifiers_.begin(), MenuItemIDSeparator); |
| } |
| @@ -233,8 +231,8 @@ void AutofillPopupControllerImpl::UpdateDataListValues( |
| // Add the values that are the same for all data list elements. |
| icons_.insert(icons_.begin(), values.size(), base::string16()); |
| identifiers_.insert(identifiers_.begin(), |
| - values.size(), |
| - WebAutofillClient::MenuItemIDDataListEntry); |
| + values.size(), |
|
Evan Stade
2014/02/11 18:56:39
bad indent
gnana
2014/02/12 13:34:09
Done.
|
| + MenuItemIDDataListEntry); |
| UpdateBoundsAndRedrawPopup(); |
| } |
| @@ -345,12 +343,12 @@ bool AutofillPopupControllerImpl::CanDelete(size_t index) const { |
| // not be considered to be deleteable. |
| int id = identifiers_[index]; |
| return id > 0 || |
| - id == WebAutofillClient::MenuItemIDAutocompleteEntry || |
| - id == WebAutofillClient::MenuItemIDPasswordEntry; |
| + id == MenuItemIDAutocompleteEntry || |
| + id == MenuItemIDPasswordEntry; |
| } |
| bool AutofillPopupControllerImpl::IsWarning(size_t index) const { |
| - return identifiers_[index] == WebAutofillClient::MenuItemIDWarningMessage; |
| + return identifiers_[index] == MenuItemIDWarningMessage; |
| } |
| gfx::Rect AutofillPopupControllerImpl::GetRowBounds(size_t index) { |
| @@ -411,7 +409,7 @@ const std::vector<int>& AutofillPopupControllerImpl::identifiers() const { |
| #if !defined(OS_ANDROID) |
| const gfx::FontList& AutofillPopupControllerImpl::GetNameFontListForRow( |
| size_t index) const { |
| - if (identifiers_[index] == WebAutofillClient::MenuItemIDWarningMessage) |
| + if (identifiers_[index] == MenuItemIDWarningMessage) |
| return warning_font_list_; |
| return name_font_list_; |
| @@ -541,24 +539,24 @@ int AutofillPopupControllerImpl::LineFromY(int y) { |
| } |
| int AutofillPopupControllerImpl::GetRowHeightFromId(int identifier) const { |
| - if (identifier == WebAutofillClient::MenuItemIDSeparator) |
| + if (identifier == MenuItemIDSeparator) |
| return kSeparatorHeight; |
| return kRowHeight; |
| } |
| bool AutofillPopupControllerImpl::CanAccept(int id) { |
| - return id != WebAutofillClient::MenuItemIDSeparator && |
| - id != WebAutofillClient::MenuItemIDWarningMessage; |
| + return id != MenuItemIDSeparator && |
|
Evan Stade
2014/02/11 18:56:39
unwrap?
gnana
2014/02/12 13:34:09
Done.
|
| + id != MenuItemIDWarningMessage; |
| } |
| bool AutofillPopupControllerImpl::HasSuggestions() { |
| return identifiers_.size() != 0 && |
| (identifiers_[0] > 0 || |
| identifiers_[0] == |
|
Evan Stade
2014/02/11 18:56:39
un-wrap
gnana
2014/02/12 13:34:09
Done.
|
| - WebAutofillClient::MenuItemIDAutocompleteEntry || |
| - identifiers_[0] == WebAutofillClient::MenuItemIDPasswordEntry || |
| - identifiers_[0] == WebAutofillClient::MenuItemIDDataListEntry); |
| + MenuItemIDAutocompleteEntry || |
| + identifiers_[0] == MenuItemIDPasswordEntry || |
| + identifiers_[0] == MenuItemIDDataListEntry); |
| } |
| void AutofillPopupControllerImpl::SetValues( |