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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 14571003: Don't display drop down arrows in rAc dialog unless there is a suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dont break android Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 case ADDRESS_HOME_COUNTRY: 680 case ADDRESS_HOME_COUNTRY:
681 return &country_combobox_model_; 681 return &country_combobox_model_;
682 682
683 default: 683 default:
684 return NULL; 684 return NULL;
685 } 685 }
686 } 686 }
687 687
688 ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSection( 688 ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSection(
689 DialogSection section) { 689 DialogSection section) {
690 SuggestionsMenuModel* model = SuggestionsMenuModelForSection(section);
691 // The shipping section menu is special. It will always show because there is
692 // a choice between "Use billing" and "enter new".
693 if (section == SECTION_SHIPPING)
694 return model;
695
696 // For other sections, only show a menu if there's at least one suggestion.
697 for (int i = 0; i < model->GetItemCount(); ++i) {
698 if (IsASuggestionItemKey(model->GetItemKeyAt(i)))
699 return model;
700 }
701
702 return NULL;
703 }
704
705 #if defined(OS_ANDROID)
706 ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSectionHack(
707 DialogSection section) {
690 return SuggestionsMenuModelForSection(section); 708 return SuggestionsMenuModelForSection(section);
691 } 709 }
710 #endif
692 711
693 ui::MenuModel* AutofillDialogControllerImpl::MenuModelForAccountChooser() { 712 ui::MenuModel* AutofillDialogControllerImpl::MenuModelForAccountChooser() {
694 // If there were unrecoverable Wallet errors, or if there are choices other 713 // If there were unrecoverable Wallet errors, or if there are choices other
695 // than "Pay without the wallet", show the full menu. 714 // than "Pay without the wallet", show the full menu.
696 if (account_chooser_model_.had_wallet_error() || 715 if (account_chooser_model_.had_wallet_error() ||
697 account_chooser_model_.HasAccountsToChoose()) { 716 account_chooser_model_.HasAccountsToChoose()) {
698 return &account_chooser_model_; 717 return &account_chooser_model_;
699 } 718 }
700 719
701 // Otherwise, there is no menu, just a sign in link. 720 // Otherwise, there is no menu, just a sign in link.
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 url, 2392 url,
2374 content::PAGE_TRANSITION_AUTO_BOOKMARK); 2393 content::PAGE_TRANSITION_AUTO_BOOKMARK);
2375 params.disposition = NEW_FOREGROUND_TAB; 2394 params.disposition = NEW_FOREGROUND_TAB;
2376 chrome::Navigate(&params); 2395 chrome::Navigate(&params);
2377 #else 2396 #else
2378 // TODO(estade): use TabModelList? 2397 // TODO(estade): use TabModelList?
2379 #endif 2398 #endif
2380 } 2399 }
2381 2400
2382 } // namespace autofill 2401 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698