Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: chrome/browser/ui/views/certificate_selector.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/certificate_selector.h" 5 #include "chrome/browser/ui/views/certificate_selector.h"
6 6
7 #include <stddef.h> // For size_t. 7 #include <stddef.h> // For size_t.
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void CertificateSelector::Show() { 170 void CertificateSelector::Show() {
171 constrained_window::ShowWebModalDialogViews(this, web_contents_); 171 constrained_window::ShowWebModalDialogViews(this, web_contents_);
172 172
173 // Select the first row automatically. This must be done after the dialog has 173 // Select the first row automatically. This must be done after the dialog has
174 // been created. 174 // been created.
175 table_->Select(0); 175 table_->Select(0);
176 } 176 }
177 177
178 void CertificateSelector::InitWithText(scoped_ptr<views::View> text_label) { 178 void CertificateSelector::InitWithText(
179 std::unique_ptr<views::View> text_label) {
179 views::GridLayout* const layout = views::GridLayout::CreatePanel(this); 180 views::GridLayout* const layout = views::GridLayout::CreatePanel(this);
180 SetLayoutManager(layout); 181 SetLayoutManager(layout);
181 182
182 const int kColumnSetId = 0; 183 const int kColumnSetId = 0;
183 views::ColumnSet* const column_set = layout->AddColumnSet(kColumnSetId); 184 views::ColumnSet* const column_set = layout->AddColumnSet(kColumnSetId);
184 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, 185 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
185 views::GridLayout::USE_PREF, 0, 0); 186 views::GridLayout::USE_PREF, 0, 0);
186 187
187 layout->StartRow(0, kColumnSetId); 188 layout->StartRow(0, kColumnSetId);
188 layout->AddView(text_label.release()); 189 layout->AddView(text_label.release());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return button != ui::DIALOG_BUTTON_OK || GetSelectedCert() != nullptr; 230 return button != ui::DIALOG_BUTTON_OK || GetSelectedCert() != nullptr;
230 } 231 }
231 232
232 views::View* CertificateSelector::GetInitiallyFocusedView() { 233 views::View* CertificateSelector::GetInitiallyFocusedView() {
233 DCHECK(table_); 234 DCHECK(table_);
234 return table_; 235 return table_;
235 } 236 }
236 237
237 views::View* CertificateSelector::CreateExtraView() { 238 views::View* CertificateSelector::CreateExtraView() {
238 DCHECK(!view_cert_button_); 239 DCHECK(!view_cert_button_);
239 scoped_ptr<views::LabelButton> button(new views::LabelButton( 240 std::unique_ptr<views::LabelButton> button(new views::LabelButton(
240 this, l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON))); 241 this, l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON)));
241 button->SetStyle(views::Button::STYLE_BUTTON); 242 button->SetStyle(views::Button::STYLE_BUTTON);
242 view_cert_button_ = button.get(); 243 view_cert_button_ = button.get();
243 return button.release(); 244 return button.release();
244 } 245 }
245 246
246 ui::ModalType CertificateSelector::GetModalType() const { 247 ui::ModalType CertificateSelector::GetModalType() const {
247 return ui::MODAL_TYPE_CHILD; 248 return ui::MODAL_TYPE_CHILD;
248 } 249 }
249 250
(...skipping 10 matching lines...) Expand all
260 void CertificateSelector::OnSelectionChanged() { 261 void CertificateSelector::OnSelectionChanged() {
261 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr); 262 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr);
262 } 263 }
263 264
264 void CertificateSelector::OnDoubleClick() { 265 void CertificateSelector::OnDoubleClick() {
265 if (GetSelectedCert()) 266 if (GetSelectedCert())
266 GetDialogClientView()->AcceptWindow(); 267 GetDialogClientView()->AcceptWindow();
267 } 268 }
268 269
269 } // namespace chrome 270 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/certificate_selector.h ('k') | chrome/browser/ui/views/certificate_selector_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698