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

Side by Side Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 8212003: [chromiumos] Start TPM token initialization re-tries on login (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove RequestCertificates() call from wifi|vpn views. Created 9 years, 2 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/options/vpn_config_view.h" 5 #include "chrome/browser/chromeos/options/vpn_config_view.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return cert_library_->GetUserCertificates().GetPkcs11IdAt(selected); 361 return cert_library_->GetUserCertificates().GetPkcs11IdAt(selected);
362 } 362 }
363 } 363 }
364 364
365 void VPNConfigView::Init(VirtualNetwork* vpn) { 365 void VPNConfigView::Init(VirtualNetwork* vpn) {
366 views::GridLayout* layout = views::GridLayout::CreatePanel(this); 366 views::GridLayout* layout = views::GridLayout::CreatePanel(this);
367 SetLayoutManager(layout); 367 SetLayoutManager(layout);
368 368
369 // VPN may require certificates, so always set the library and observe. 369 // VPN may require certificates, so always set the library and observe.
370 cert_library_ = chromeos::CrosLibrary::Get()->GetCertLibrary(); 370 cert_library_ = chromeos::CrosLibrary::Get()->GetCertLibrary();
371 cert_library_->AddObserver(this); 371
372 cert_library_->RequestCertificates(); 372 // Setup a callback if certificates are yet to be loaded.
373 if (!cert_library_->CertificatesLoaded())
374 cert_library_->AddObserver(this);
373 375
374 int column_view_set_id = 0; 376 int column_view_set_id = 0;
375 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); 377 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id);
376 // Label. 378 // Label.
377 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, 379 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1,
378 views::GridLayout::USE_PREF, 0, 0); 380 views::GridLayout::USE_PREF, 0, 0);
379 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); 381 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing);
380 // Textfield, combobox. 382 // Textfield, combobox.
381 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, 383 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
382 views::GridLayout::USE_PREF, 0, 384 views::GridLayout::USE_PREF, 0,
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 return std::string(); 710 return std::string();
709 std::string untrimmed = UTF16ToUTF8(textfield->text()); 711 std::string untrimmed = UTF16ToUTF8(textfield->text());
710 if (!trim_whitespace) 712 if (!trim_whitespace)
711 return untrimmed; 713 return untrimmed;
712 std::string result; 714 std::string result;
713 TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result); 715 TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result);
714 return result; 716 return result;
715 } 717 }
716 718
717 } // namespace chromeos 719 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698