| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/crypto_module_password_dialog_view.h" | 5 #include "chrome/browser/ui/views/crypto_module_password_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "ui/base/events/event.h" | 9 #include "ui/base/events/event.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 ui::ModalType CryptoModulePasswordDialogView::GetModalType() const { | 42 ui::ModalType CryptoModulePasswordDialogView::GetModalType() const { |
| 43 return ui::MODAL_TYPE_WINDOW; | 43 return ui::MODAL_TYPE_WINDOW; |
| 44 } | 44 } |
| 45 | 45 |
| 46 string16 CryptoModulePasswordDialogView::GetWindowTitle() const { | 46 string16 CryptoModulePasswordDialogView::GetWindowTitle() const { |
| 47 return l10n_util::GetStringUTF16(IDS_CRYPTO_MODULE_AUTH_DIALOG_TITLE); | 47 return l10n_util::GetStringUTF16(IDS_CRYPTO_MODULE_AUTH_DIALOG_TITLE); |
| 48 } | 48 } |
| 49 | 49 |
| 50 views::View* CryptoModulePasswordDialogView::GetContentsView() { | |
| 51 return this; | |
| 52 } | |
| 53 | |
| 54 string16 CryptoModulePasswordDialogView::GetDialogButtonLabel( | 50 string16 CryptoModulePasswordDialogView::GetDialogButtonLabel( |
| 55 ui::DialogButton button) const { | 51 ui::DialogButton button) const { |
| 56 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK ? | 52 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK ? |
| 57 IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL : IDS_CANCEL); | 53 IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL : IDS_CANCEL); |
| 58 } | 54 } |
| 59 | 55 |
| 60 bool CryptoModulePasswordDialogView::Cancel() { | 56 bool CryptoModulePasswordDialogView::Cancel() { |
| 61 callback_.Run(static_cast<const char*>(NULL)); | 57 callback_.Run(static_cast<const char*>(NULL)); |
| 62 const string16 empty; | 58 const string16 empty; |
| 63 password_entry_->SetText(empty); | 59 password_entry_->SetText(empty); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 bool retry, | 153 bool retry, |
| 158 CryptoModulePasswordReason reason, | 154 CryptoModulePasswordReason reason, |
| 159 const std::string& server, | 155 const std::string& server, |
| 160 const CryptoModulePasswordCallback& callback) { | 156 const CryptoModulePasswordCallback& callback) { |
| 161 CryptoModulePasswordDialogView* dialog = | 157 CryptoModulePasswordDialogView* dialog = |
| 162 new CryptoModulePasswordDialogView(slot_name, reason, server, callback); | 158 new CryptoModulePasswordDialogView(slot_name, reason, server, callback); |
| 163 views::Widget::CreateWindow(dialog)->Show(); | 159 views::Widget::CreateWindow(dialog)->Show(); |
| 164 } | 160 } |
| 165 | 161 |
| 166 } // namespace chrome | 162 } // namespace chrome |
| OLD | NEW |