| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // The dialog is closed by the controller. | 155 // The dialog is closed by the controller. |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 | 158 |
| 159 int AccountChooserDialogView::GetDialogButtons() const { | 159 int AccountChooserDialogView::GetDialogButtons() const { |
| 160 if (show_signin_button_) | 160 if (show_signin_button_) |
| 161 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; | 161 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; |
| 162 return ui::DIALOG_BUTTON_CANCEL; | 162 return ui::DIALOG_BUTTON_CANCEL; |
| 163 } | 163 } |
| 164 | 164 |
| 165 bool AccountChooserDialogView::ShouldDefaultButtonBeBlue() const { | |
| 166 return show_signin_button_; | |
| 167 } | |
| 168 | |
| 169 base::string16 AccountChooserDialogView::GetDialogButtonLabel( | 165 base::string16 AccountChooserDialogView::GetDialogButtonLabel( |
| 170 ui::DialogButton button) const { | 166 ui::DialogButton button) const { |
| 171 int message_id = 0; | 167 int message_id = 0; |
| 172 if (button == ui::DIALOG_BUTTON_OK) | 168 if (button == ui::DIALOG_BUTTON_OK) |
| 173 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; | 169 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; |
| 174 else if (button == ui::DIALOG_BUTTON_CANCEL) | 170 else if (button == ui::DIALOG_BUTTON_CANCEL) |
| 175 message_id = IDS_APP_CANCEL; | 171 message_id = IDS_APP_CANCEL; |
| 176 else | 172 else |
| 177 NOTREACHED(); | 173 NOTREACHED(); |
| 178 return l10n_util::GetStringUTF16(message_id); | 174 return l10n_util::GetStringUTF16(message_id); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 controller_->GetLocalForms(), | 224 controller_->GetLocalForms(), |
| 229 this, | 225 this, |
| 230 GetProfileFromWebContents(web_contents_)->GetRequestContext())); | 226 GetProfileFromWebContents(web_contents_)->GetRequestContext())); |
| 231 layout->AddPaddingRow(0, dialog_insets.bottom()); | 227 layout->AddPaddingRow(0, dialog_insets.bottom()); |
| 232 } | 228 } |
| 233 | 229 |
| 234 AccountChooserPrompt* CreateAccountChooserPromptView( | 230 AccountChooserPrompt* CreateAccountChooserPromptView( |
| 235 PasswordDialogController* controller, content::WebContents* web_contents) { | 231 PasswordDialogController* controller, content::WebContents* web_contents) { |
| 236 return new AccountChooserDialogView(controller, web_contents); | 232 return new AccountChooserDialogView(controller, web_contents); |
| 237 } | 233 } |
| OLD | NEW |