diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-04 01:58:30 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-04 01:58:30 +0000 |
commit | bdf8567782391fce5829bf3bc2db0e615398472e (patch) | |
tree | 506f474a5d042d70ba5d8f36e5f2fe83465276e0 /chrome/browser/autofill/autofill_infobar_delegate.cc | |
parent | 975967a16155b8cc18a1f47db8de2212f25b456f (diff) | |
download | chromium_src-bdf8567782391fce5829bf3bc2db0e615398472e.zip chromium_src-bdf8567782391fce5829bf3bc2db0e615398472e.tar.gz chromium_src-bdf8567782391fce5829bf3bc2db0e615398472e.tar.bz2 |
Add tests for AutoFillInfoBarDelegate, with a fix to only return a button label if the button type is valid.
BUG=none
TEST=AutoFillInfoBarDelegateTest
Review URL: http://codereview.chromium.org/668002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_infobar_delegate.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_infobar_delegate.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/autofill/autofill_infobar_delegate.cc b/chrome/browser/autofill/autofill_infobar_delegate.cc index 3e6582f..e2c0648 100644 --- a/chrome/browser/autofill/autofill_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_infobar_delegate.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -61,8 +61,12 @@ std::wstring AutoFillInfoBarDelegate::GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const { if (button == BUTTON_OK) return l10n_util::GetString(IDS_AUTOFILL_INFOBAR_ACCEPT); + else if (button == BUTTON_CANCEL) + return l10n_util::GetString(IDS_AUTOFILL_INFOBAR_DENY); + else + NOTREACHED(); - return l10n_util::GetString(IDS_AUTOFILL_INFOBAR_DENY); + return std::wstring(); } bool AutoFillInfoBarDelegate::Accept() { |