| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/passwords/account_chooser_dialog_view.h" | 5 #include "chrome/browser/ui/views/passwords/account_chooser_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // The dialog is closed by the controller. | 157 // The dialog is closed by the controller. |
| 158 return false; | 158 return false; |
| 159 } | 159 } |
| 160 | 160 |
| 161 int AccountChooserDialogView::GetDialogButtons() const { | 161 int AccountChooserDialogView::GetDialogButtons() const { |
| 162 if (show_signin_button_) | 162 if (show_signin_button_) |
| 163 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; | 163 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; |
| 164 return ui::DIALOG_BUTTON_CANCEL; | 164 return ui::DIALOG_BUTTON_CANCEL; |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool AccountChooserDialogView::ShouldDefaultButtonBeBlue() const { | |
| 168 return show_signin_button_; | |
| 169 } | |
| 170 | |
| 171 base::string16 AccountChooserDialogView::GetDialogButtonLabel( | 167 base::string16 AccountChooserDialogView::GetDialogButtonLabel( |
| 172 ui::DialogButton button) const { | 168 ui::DialogButton button) const { |
| 173 int message_id = 0; | 169 int message_id = 0; |
| 174 if (button == ui::DIALOG_BUTTON_OK) | 170 if (button == ui::DIALOG_BUTTON_OK) |
| 175 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; | 171 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; |
| 176 else if (button == ui::DIALOG_BUTTON_CANCEL) | 172 else if (button == ui::DIALOG_BUTTON_CANCEL) |
| 177 message_id = IDS_APP_CANCEL; | 173 message_id = IDS_APP_CANCEL; |
| 178 else | 174 else |
| 179 NOTREACHED(); | 175 NOTREACHED(); |
| 180 return l10n_util::GetStringUTF16(message_id); | 176 return l10n_util::GetStringUTF16(message_id); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 controller_->GetLocalForms(), | 226 controller_->GetLocalForms(), |
| 231 this, | 227 this, |
| 232 GetProfileFromWebContents(web_contents_)->GetRequestContext())); | 228 GetProfileFromWebContents(web_contents_)->GetRequestContext())); |
| 233 layout->AddPaddingRow(0, dialog_insets.bottom()); | 229 layout->AddPaddingRow(0, dialog_insets.bottom()); |
| 234 } | 230 } |
| 235 | 231 |
| 236 AccountChooserPrompt* CreateAccountChooserPromptView( | 232 AccountChooserPrompt* CreateAccountChooserPromptView( |
| 237 PasswordDialogController* controller, content::WebContents* web_contents) { | 233 PasswordDialogController* controller, content::WebContents* web_contents) { |
| 238 return new AccountChooserDialogView(controller, web_contents); | 234 return new AccountChooserDialogView(controller, web_contents); |
| 239 } | 235 } |
| OLD | NEW |