| 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/passwords/manage_passwords_view_utils.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
| 10 #include "chrome/browser/ui/passwords/password_dialog_controller.h" | 10 #include "chrome/browser/ui/passwords/password_dialog_controller.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 int message_id = 0; | 163 int message_id = 0; |
| 164 if (button == ui::DIALOG_BUTTON_OK) | 164 if (button == ui::DIALOG_BUTTON_OK) |
| 165 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; | 165 message_id = IDS_PASSWORD_MANAGER_ACCOUNT_CHOOSER_SIGN_IN; |
| 166 else if (button == ui::DIALOG_BUTTON_CANCEL) | 166 else if (button == ui::DIALOG_BUTTON_CANCEL) |
| 167 message_id = IDS_APP_CANCEL; | 167 message_id = IDS_APP_CANCEL; |
| 168 else | 168 else |
| 169 NOTREACHED(); | 169 NOTREACHED(); |
| 170 return l10n_util::GetStringUTF16(message_id); | 170 return l10n_util::GetStringUTF16(message_id); |
| 171 } | 171 } |
| 172 | 172 |
| 173 gfx::Size AccountChooserDialogView::GetPreferredSize() const { | 173 gfx::Size AccountChooserDialogView::GetUnsnappedPreferredSize() const { |
| 174 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); | 174 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void AccountChooserDialogView::StyledLabelLinkClicked(views::StyledLabel* label, | 177 void AccountChooserDialogView::StyledLabelLinkClicked(views::StyledLabel* label, |
| 178 const gfx::Range& range, | 178 const gfx::Range& range, |
| 179 int event_flags) { | 179 int event_flags) { |
| 180 controller_->OnSmartLockLinkClicked(); | 180 controller_->OnSmartLockLinkClicked(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void AccountChooserDialogView::ButtonPressed(views::Button* sender, | 183 void AccountChooserDialogView::ButtonPressed(views::Button* sender, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 GetProfileFromWebContents(web_contents_)->GetRequestContext())); | 217 GetProfileFromWebContents(web_contents_)->GetRequestContext())); |
| 218 // DialogClientView adds kRelatedControlVerticalSpacing padding once more for | 218 // DialogClientView adds kRelatedControlVerticalSpacing padding once more for |
| 219 // the buttons. | 219 // the buttons. |
| 220 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 220 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 221 } | 221 } |
| 222 | 222 |
| 223 AccountChooserPrompt* CreateAccountChooserPromptView( | 223 AccountChooserPrompt* CreateAccountChooserPromptView( |
| 224 PasswordDialogController* controller, content::WebContents* web_contents) { | 224 PasswordDialogController* controller, content::WebContents* web_contents) { |
| 225 return new AccountChooserDialogView(controller, web_contents); | 225 return new AccountChooserDialogView(controller, web_contents); |
| 226 } | 226 } |
| OLD | NEW |