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

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: Address wtc's comments 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return cert_library_->GetUserCertificates().GetPkcs11IdAt(selected); 363 return cert_library_->GetUserCertificates().GetPkcs11IdAt(selected);
364 } 364 }
365 } 365 }
366 366
367 void VPNConfigView::Init(VirtualNetwork* vpn) { 367 void VPNConfigView::Init(VirtualNetwork* vpn) {
368 views::GridLayout* layout = views::GridLayout::CreatePanel(this); 368 views::GridLayout* layout = views::GridLayout::CreatePanel(this);
369 SetLayoutManager(layout); 369 SetLayoutManager(layout);
370 370
371 // VPN may require certificates, so always set the library and observe. 371 // VPN may require certificates, so always set the library and observe.
372 cert_library_ = chromeos::CrosLibrary::Get()->GetCertLibrary(); 372 cert_library_ = chromeos::CrosLibrary::Get()->GetCertLibrary();
373 cert_library_->AddObserver(this); 373
374 cert_library_->RequestCertificates(); 374 // Setup a callback if certificates are yet to be loaded.
375 if (!cert_library_->CertificatesLoaded())
376 cert_library_->AddObserver(this);
375 377
376 int column_view_set_id = 0; 378 int column_view_set_id = 0;
377 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); 379 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id);
378 // Label. 380 // Label.
379 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, 381 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1,
380 views::GridLayout::USE_PREF, 0, 0); 382 views::GridLayout::USE_PREF, 0, 0);
381 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); 383 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing);
382 // Textfield, combobox. 384 // Textfield, combobox.
383 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, 385 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
384 views::GridLayout::USE_PREF, 0, 386 views::GridLayout::USE_PREF, 0,
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 return std::string(); 709 return std::string();
708 std::string untrimmed = UTF16ToUTF8(textfield->text()); 710 std::string untrimmed = UTF16ToUTF8(textfield->text());
709 if (!trim_whitespace) 711 if (!trim_whitespace)
710 return untrimmed; 712 return untrimmed;
711 std::string result; 713 std::string result;
712 TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result); 714 TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result);
713 return result; 715 return result;
714 } 716 }
715 717
716 } // namespace chromeos 718 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager.cc ('k') | chrome/browser/chromeos/options/wifi_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698