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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_models.cc

Issue 14129005: Remove "Use billing for shipping" checkbox in favor of item in suggestions menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad merge Created 7 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/ui/autofill/autofill_dialog_models.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.cc b/chrome/browser/ui/autofill/autofill_dialog_models.cc
index 229fea395cf5c550bbb5270b6cc9f38c5bdcc1b8..eb4293f33b43389c263577e7800687422276e201 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_models.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_models.cc
@@ -76,6 +76,15 @@ std::string SuggestionsMenuModel::GetItemKeyForCheckedItem() const {
return items_[checked_item_].first;
}
+void SuggestionsMenuModel::SetCheckedItem(const std::string& item_key) {
+ for (size_t i = 0; i < items_.size(); ++i) {
+ if (items_[i].first == item_key) {
+ checked_item_ = i;
+ break;
Dan Beam 2013/04/16 03:01:14 return;
Evan Stade 2013/04/16 19:06:20 sure, why not
+ }
+ }
Dan Beam 2013/04/16 03:01:14 NOTREACHED(); IMO (unless this is valid for some r
Evan Stade 2013/04/16 19:06:20 Done.
+}
+
bool SuggestionsMenuModel::IsCommandIdChecked(
int command_id) const {
return checked_item_ == command_id;
@@ -93,8 +102,7 @@ bool SuggestionsMenuModel::GetAcceleratorForCommandId(
}
void SuggestionsMenuModel::ExecuteCommand(int command_id, int event_flags) {
- checked_item_ = command_id;
- delegate_->SuggestionItemSelected(*this);
+ delegate_->SuggestionItemSelected(this, GetItemKeyAt(command_id));
}
// AccountChooserModel ---------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698