| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/autofill/autofill_cc_infobar.h" | 5 #include "chrome/browser/autofill/autofill_cc_infobar.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "chrome/browser/views/event_utils.h" | 9 #include "chrome/browser/views/event_utils.h" |
| 10 #include "chrome/browser/views/infobars/infobar_button_border.h" | 10 #include "chrome/browser/views/infobars/infobar_button_border.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 views::TextButton* SaveCCInfoConfirmInfoBar::CreateTextButton( | 166 views::TextButton* SaveCCInfoConfirmInfoBar::CreateTextButton( |
| 167 const std::wstring& text) { | 167 const std::wstring& text) { |
| 168 views::TextButton* text_button = new views::TextButton(this, std::wstring()); | 168 views::TextButton* text_button = new views::TextButton(this, std::wstring()); |
| 169 text_button->set_border(new InfoBarButtonBorder); | 169 text_button->set_border(new InfoBarButtonBorder); |
| 170 | 170 |
| 171 // Set font colors for different states. | 171 // Set font colors for different states. |
| 172 text_button->SetEnabledColor(SK_ColorBLACK); | 172 text_button->SetEnabledColor(SK_ColorBLACK); |
| 173 text_button->SetHighlightColor(SK_ColorBLACK); | 173 text_button->SetHighlightColor(SK_ColorBLACK); |
| 174 text_button->SetHoverColor(SK_ColorBLACK); | 174 text_button->SetHoverColor(SK_ColorBLACK); |
| 175 text_button->SetNormalHasBorder(true); | 175 text_button->SetNormalHasBorder(true); |
| 176 text_button->SetShowHighlighted(true); | |
| 177 | 176 |
| 178 // Set font then text, then size button to fit text. | 177 // Set font then text, then size button to fit text. |
| 179 text_button->SetFont(ResourceBundle::GetSharedInstance().GetFont( | 178 text_button->SetFont(ResourceBundle::GetSharedInstance().GetFont( |
| 180 ResourceBundle::MediumFont)); | 179 ResourceBundle::MediumFont)); |
| 181 text_button->SetText(text); | 180 text_button->SetText(text); |
| 182 text_button->ClearMaxTextSize(); | 181 text_button->ClearMaxTextSize(); |
| 183 text_button->SizeToPreferredSize(); | 182 text_button->SizeToPreferredSize(); |
| 184 return text_button; | 183 return text_button; |
| 185 } | 184 } |
| 186 | 185 |
| 187 ConfirmInfoBarDelegate* SaveCCInfoConfirmInfoBar::GetDelegate() { | 186 ConfirmInfoBarDelegate* SaveCCInfoConfirmInfoBar::GetDelegate() { |
| 188 return delegate()->AsConfirmInfoBarDelegate(); | 187 return delegate()->AsConfirmInfoBarDelegate(); |
| 189 } | 188 } |
| 190 | 189 |
| 191 InfoBar* CreateAutofillCcInfoBar(ConfirmInfoBarDelegate* delegate) { | 190 InfoBar* CreateAutofillCcInfoBar(ConfirmInfoBarDelegate* delegate) { |
| 192 DCHECK(delegate); | 191 DCHECK(delegate); |
| 193 return new SaveCCInfoConfirmInfoBar(delegate); | 192 return new SaveCCInfoConfirmInfoBar(delegate); |
| 194 } | 193 } |
| 195 | 194 |
| OLD | NEW |