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

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: sync 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
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 suggestion_state.extra_icon.AsImageSkia()); 1366 suggestion_state.extra_icon.AsImageSkia());
1367 } 1367 }
1368 1368
1369 group.manual_input->SetVisible(!show_suggestions); 1369 group.manual_input->SetVisible(!show_suggestions);
1370 1370
1371 // Show or hide the "Save in chrome" checkbox. If nothing is in editing mode, 1371 // Show or hide the "Save in chrome" checkbox. If nothing is in editing mode,
1372 // hide. If the controller tells us not to show it, likewise hide. 1372 // hide. If the controller tells us not to show it, likewise hide.
1373 save_in_chrome_checkbox_->SetVisible( 1373 save_in_chrome_checkbox_->SetVisible(
1374 controller_->ShouldOfferToSaveInChrome()); 1374 controller_->ShouldOfferToSaveInChrome());
1375 1375
1376 const bool has_suggestions = 1376 const bool has_menu = !!controller_->MenuModelForSection(group.section);
1377 controller_->MenuModelForSection(group.section)->GetItemCount() > 0;
1378 1377
1379 if (group.suggested_button) 1378 if (group.suggested_button)
1380 group.suggested_button->SetVisible(has_suggestions); 1379 group.suggested_button->SetVisible(has_menu);
1381 1380
1382 if (group.container) { 1381 if (group.container) {
1383 group.container->SetForwardMouseEvents(has_suggestions && show_suggestions); 1382 group.container->SetForwardMouseEvents(has_menu && show_suggestions);
1384 group.container->SetVisible(controller_->SectionIsActive(group.section)); 1383 group.container->SetVisible(controller_->SectionIsActive(group.section));
1385 } 1384 }
1386 1385
1387 ContentsPreferredSizeChanged(); 1386 ContentsPreferredSizeChanged();
1388 } 1387 }
1389 1388
1390 bool AutofillDialogViews::ValidateGroup( 1389 bool AutofillDialogViews::ValidateGroup(
1391 DetailsGroup* group, 1390 DetailsGroup* group,
1392 AutofillDialogController::ValidationType validation_type) { 1391 AutofillDialogController::ValidationType validation_type) {
1393 DCHECK(group->container->visible()); 1392 DCHECK(group->container->visible());
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 1578 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
1580 : section(section), 1579 : section(section),
1581 container(NULL), 1580 container(NULL),
1582 manual_input(NULL), 1581 manual_input(NULL),
1583 suggested_info(NULL), 1582 suggested_info(NULL),
1584 suggested_button(NULL) {} 1583 suggested_button(NULL) {}
1585 1584
1586 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 1585 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
1587 1586
1588 } // namespace autofill 1587 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698