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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/autofill/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 suggestion_state.extra_icon.AsImageSkia()); 1360 suggestion_state.extra_icon.AsImageSkia());
1361 } 1361 }
1362 1362
1363 group.manual_input->SetVisible(!show_suggestions); 1363 group.manual_input->SetVisible(!show_suggestions);
1364 1364
1365 // Show or hide the "Save in chrome" checkbox. If nothing is in editing mode, 1365 // Show or hide the "Save in chrome" checkbox. If nothing is in editing mode,
1366 // hide. If the controller tells us not to show it, likewise hide. 1366 // hide. If the controller tells us not to show it, likewise hide.
1367 save_in_chrome_checkbox_->SetVisible( 1367 save_in_chrome_checkbox_->SetVisible(
1368 controller_->ShouldOfferToSaveInChrome()); 1368 controller_->ShouldOfferToSaveInChrome());
1369 1369
1370 const bool has_suggestions = 1370 const bool has_menu = !!controller_->MenuModelForSection(group.section);
1371 controller_->MenuModelForSection(group.section)->GetItemCount() > 0;
1372 1371
1373 if (group.suggested_button) 1372 if (group.suggested_button)
1374 group.suggested_button->SetVisible(has_suggestions); 1373 group.suggested_button->SetVisible(has_menu);
1375 1374
1376 if (group.container) { 1375 if (group.container) {
1377 group.container->SetForwardMouseEvents(has_suggestions && show_suggestions); 1376 group.container->SetForwardMouseEvents(has_menu && show_suggestions);
1378 group.container->SetVisible(controller_->SectionIsActive(group.section)); 1377 group.container->SetVisible(controller_->SectionIsActive(group.section));
1379 } 1378 }
1380 1379
1381 ContentsPreferredSizeChanged(); 1380 ContentsPreferredSizeChanged();
1382 } 1381 }
1383 1382
1384 bool AutofillDialogViews::ValidateGroup( 1383 bool AutofillDialogViews::ValidateGroup(
1385 DetailsGroup* group, 1384 DetailsGroup* group,
1386 AutofillDialogController::ValidationType validation_type) { 1385 AutofillDialogController::ValidationType validation_type) {
1387 DCHECK(group->container->visible()); 1386 DCHECK(group->container->visible());
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 1568 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
1570 : section(section), 1569 : section(section),
1571 container(NULL), 1570 container(NULL),
1572 manual_input(NULL), 1571 manual_input(NULL),
1573 suggested_info(NULL), 1572 suggested_info(NULL),
1574 suggested_button(NULL) {} 1573 suggested_button(NULL) {}
1575 1574
1576 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 1575 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
1577 1576
1578 } // namespace autofill 1577 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698