| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser_dialogs.h" | 8 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 9 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 views::GridLayout::LEADING, 0, | 137 views::GridLayout::LEADING, 0, |
| 138 views::GridLayout::USE_PREF, 0, 0); | 138 views::GridLayout::USE_PREF, 0, 0); |
| 139 column_set->AddPaddingColumn( | 139 column_set->AddPaddingColumn( |
| 140 0, | 140 0, |
| 141 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE)); | 141 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE)); |
| 142 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 142 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 143 views::GridLayout::USE_PREF, 0, 0); | 143 views::GridLayout::USE_PREF, 0, 0); |
| 144 | 144 |
| 145 layout->StartRow(0, 0); | 145 layout->StartRow(0, 0); |
| 146 layout->AddView(reason_label_); | 146 layout->AddView(reason_label_); |
| 147 layout->AddPaddingRow( | 147 layout->AddPaddingRow(0, provider->GetDistanceMetric( |
| 148 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL)); | 148 views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); |
| 149 | 149 |
| 150 layout->StartRow(0, 1); | 150 layout->StartRow(0, 1); |
| 151 layout->AddView(password_label_); | 151 layout->AddView(password_label_); |
| 152 layout->AddView(password_entry_); | 152 layout->AddView(password_entry_); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void ShowCryptoModulePasswordDialog( | 155 void ShowCryptoModulePasswordDialog( |
| 156 const std::string& slot_name, | 156 const std::string& slot_name, |
| 157 bool retry, | 157 bool retry, |
| 158 CryptoModulePasswordReason reason, | 158 CryptoModulePasswordReason reason, |
| 159 const std::string& hostname, | 159 const std::string& hostname, |
| 160 gfx::NativeWindow parent, | 160 gfx::NativeWindow parent, |
| 161 const CryptoModulePasswordCallback& callback) { | 161 const CryptoModulePasswordCallback& callback) { |
| 162 CryptoModulePasswordDialogView* dialog = | 162 CryptoModulePasswordDialogView* dialog = |
| 163 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback); | 163 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback); |
| 164 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show(); | 164 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace chrome | 167 } // namespace chrome |
| OLD | NEW |