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/password_dialog_controller.h" | 9 #include "chrome/browser/ui/passwords/password_dialog_controller.h" |
10 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" | 10 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 bool AccountChooserDialogView::ShouldShowWindowTitle() const { | 87 bool AccountChooserDialogView::ShouldShowWindowTitle() const { |
88 // The title may contain a hyperlink. | 88 // The title may contain a hyperlink. |
89 return false; | 89 return false; |
90 } | 90 } |
91 | 91 |
92 bool AccountChooserDialogView::ShouldShowCloseButton() const { | 92 bool AccountChooserDialogView::ShouldShowCloseButton() const { |
93 return false; | 93 return false; |
94 } | 94 } |
95 | 95 |
| 96 void AccountChooserDialogView::WindowClosing() { |
| 97 if (controller_) |
| 98 controller_->OnCloseDialog(); |
| 99 } |
| 100 |
96 int AccountChooserDialogView::GetDialogButtons() const { | 101 int AccountChooserDialogView::GetDialogButtons() const { |
97 return ui::DIALOG_BUTTON_CANCEL; | 102 return ui::DIALOG_BUTTON_CANCEL; |
98 } | 103 } |
99 | 104 |
100 base::string16 AccountChooserDialogView::GetDialogButtonLabel( | 105 base::string16 AccountChooserDialogView::GetDialogButtonLabel( |
101 ui::DialogButton button) const { | 106 ui::DialogButton button) const { |
102 return l10n_util::GetStringUTF16(IDS_APP_CANCEL); | 107 return l10n_util::GetStringUTF16(IDS_APP_CANCEL); |
103 } | 108 } |
104 | 109 |
105 void AccountChooserDialogView::OnClosed() { | |
106 if (controller_) | |
107 controller_->OnCloseDialog(); | |
108 } | |
109 | |
110 gfx::Size AccountChooserDialogView::GetPreferredSize() const { | 110 gfx::Size AccountChooserDialogView::GetPreferredSize() const { |
111 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); | 111 return gfx::Size(kDesiredWidth, GetHeightForWidth(kDesiredWidth)); |
112 } | 112 } |
113 | 113 |
114 void AccountChooserDialogView::StyledLabelLinkClicked(views::StyledLabel* label, | 114 void AccountChooserDialogView::StyledLabelLinkClicked(views::StyledLabel* label, |
115 const gfx::Range& range, | 115 const gfx::Range& range, |
116 int event_flags) { | 116 int event_flags) { |
117 controller_->OnSmartLockLinkClicked(); | 117 controller_->OnSmartLockLinkClicked(); |
118 } | 118 } |
119 | 119 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 // DialogClientView adds kRelatedControlVerticalSpacing padding once more for | 168 // DialogClientView adds kRelatedControlVerticalSpacing padding once more for |
169 // the buttons. | 169 // the buttons. |
170 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 170 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
171 } | 171 } |
172 | 172 |
173 AccountChooserPrompt* CreateAccountChooserPromptView( | 173 AccountChooserPrompt* CreateAccountChooserPromptView( |
174 PasswordDialogController* controller, content::WebContents* web_contents) { | 174 PasswordDialogController* controller, content::WebContents* web_contents) { |
175 return new AccountChooserDialogView(controller, web_contents); | 175 return new AccountChooserDialogView(controller, web_contents); |
176 } | 176 } |
OLD | NEW |