OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 popup_section_ = section; | 1205 popup_section_ = section; |
1206 | 1206 |
1207 // Use our own 0-based IDs for the items. | 1207 // Use our own 0-based IDs for the items. |
1208 // TODO(estade): do we need separators and control rows like 'Clear | 1208 // TODO(estade): do we need separators and control rows like 'Clear |
1209 // Form'? | 1209 // Form'? |
1210 for (size_t i = 0; i < popup_suggestions.size(); ++i) { | 1210 for (size_t i = 0; i < popup_suggestions.size(); ++i) { |
1211 popup_suggestions[i].frontend_id = i; | 1211 popup_suggestions[i].frontend_id = i; |
1212 } | 1212 } |
1213 | 1213 |
1214 popup_controller_ = AutofillPopupControllerImpl::GetOrCreate( | 1214 popup_controller_ = AutofillPopupControllerImpl::GetOrCreate( |
1215 popup_controller_, | 1215 popup_controller_, weak_ptr_factory_.GetWeakPtr(), NULL, parent_view, |
1216 weak_ptr_factory_.GetWeakPtr(), | 1216 gfx::RectF(content_bounds), |
1217 NULL, | 1217 base::i18n::IsRTL() ? base::i18n::RIGHT_TO_LEFT |
1218 parent_view, | 1218 : base::i18n::LEFT_TO_RIGHT); |
1219 content_bounds, | |
1220 base::i18n::IsRTL() ? | |
1221 base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT); | |
1222 popup_controller_->Show(popup_suggestions); | 1219 popup_controller_->Show(popup_suggestions); |
1223 } | 1220 } |
1224 | 1221 |
1225 void AutofillDialogControllerImpl::FocusMoved() { | 1222 void AutofillDialogControllerImpl::FocusMoved() { |
1226 HidePopup(); | 1223 HidePopup(); |
1227 } | 1224 } |
1228 | 1225 |
1229 bool AutofillDialogControllerImpl::ShouldShowErrorBubble() const { | 1226 bool AutofillDialogControllerImpl::ShouldShowErrorBubble() const { |
1230 return popup_input_type_ == UNKNOWN_TYPE; | 1227 return popup_input_type_ == UNKNOWN_TYPE; |
1231 } | 1228 } |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 } | 2308 } |
2312 | 2309 |
2313 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { | 2310 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { |
2314 if (!view_) | 2311 if (!view_) |
2315 return; | 2312 return; |
2316 ScopedViewUpdates updates(view_.get()); | 2313 ScopedViewUpdates updates(view_.get()); |
2317 view_->UpdateButtonStrip(); | 2314 view_->UpdateButtonStrip(); |
2318 } | 2315 } |
2319 | 2316 |
2320 } // namespace autofill | 2317 } // namespace autofill |
OLD | NEW |