summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 04:14:54 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 04:14:54 +0000
commit1a6a6303692c83b5bd26e9a6007e084bbb1e5eab (patch)
tree1a21ac4a12685f5993c6391dba34c067bc97bad1
parent0474f0f587ab6208e1c8aaa13a0210759d943a75 (diff)
downloadchromium_src-1a6a6303692c83b5bd26e9a6007e084bbb1e5eab.zip
chromium_src-1a6a6303692c83b5bd26e9a6007e084bbb1e5eab.tar.gz
chromium_src-1a6a6303692c83b5bd26e9a6007e084bbb1e5eab.tar.bz2
Don't require login to enable CA cert settings
BUG=23658 TEST=See issue Review URL: http://codereview.chromium.org/8771019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112861 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/cros/cert_library.cc8
-rw-r--r--chrome/browser/chromeos/cros/cert_library.h3
-rw-r--r--chrome/browser/chromeos/options/wifi_config_view.cc10
3 files changed, 16 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/cros/cert_library.cc b/chrome/browser/chromeos/cros/cert_library.cc
index 8aba928..e14a814 100644
--- a/chrome/browser/chromeos/cros/cert_library.cc
+++ b/chrome/browser/chromeos/cros/cert_library.cc
@@ -110,6 +110,7 @@ class CertLibraryImpl
CertLibraryImpl() :
observer_list_(new CertLibraryObserverList),
user_logged_in_(false),
+ certificates_requested_(false),
certificates_loaded_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(certs_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(user_certs_(this)),
@@ -128,6 +129,8 @@ class CertLibraryImpl
virtual void RequestCertificates() OVERRIDE {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ certificates_requested_ = true;
+
if (!UserManager::Get()->user_is_logged_in()) {
// If we are not logged in, we cannot load any certificates.
// Set 'loaded' to true for the UI, since we are not waiting on loading.
@@ -186,6 +189,10 @@ class CertLibraryImpl
observer_list_->RemoveObserver(observer);
}
+ virtual bool CertificatesLoading() const OVERRIDE {
+ return certificates_requested_ && !certificates_loaded_;
+ }
+
virtual bool CertificatesLoaded() const OVERRIDE {
return certificates_loaded_;
}
@@ -406,6 +413,7 @@ class CertLibraryImpl
// Local state.
bool user_logged_in_;
+ bool certificates_requested_;
bool certificates_loaded_;
// Certificates.
diff --git a/chrome/browser/chromeos/cros/cert_library.h b/chrome/browser/chromeos/cros/cert_library.h
index 34934e9..3dce9a4 100644
--- a/chrome/browser/chromeos/cros/cert_library.h
+++ b/chrome/browser/chromeos/cros/cert_library.h
@@ -80,6 +80,9 @@ class CertLibrary {
// Must be called from the UI thread.
virtual void RequestCertificates() = 0;
+ // Returns true when the certificate list has been requested but not loaded.
+ virtual bool CertificatesLoading() const = 0;
+
// Returns true when the certificate list has been initiailized.
virtual bool CertificatesLoaded() const = 0;
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index a564863..2d57618 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -188,13 +188,13 @@ class ServerCACertComboboxModel : public ui::ComboboxModel {
}
virtual ~ServerCACertComboboxModel() {}
virtual int GetItemCount() {
- if (!cert_library_->CertificatesLoaded())
+ if (cert_library_->CertificatesLoading())
return 1; // "Loading"
// First "Default", then the certs, then "Do not check".
return cert_library_->GetCACertificates().Size() + 2;
}
virtual string16 GetItemAt(int combo_index) {
- if (!cert_library_->CertificatesLoaded())
+ if (cert_library_->CertificatesLoading())
return l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING);
if (combo_index == 0)
@@ -220,7 +220,7 @@ class UserCertComboboxModel : public ui::ComboboxModel {
}
virtual ~UserCertComboboxModel() {}
virtual int GetItemCount() {
- if (!cert_library_->CertificatesLoaded())
+ if (cert_library_->CertificatesLoading())
return 1; // "Loading"
int num_certs = cert_library_->GetUserCertificates().Size();
if (num_certs == 0)
@@ -228,7 +228,7 @@ class UserCertComboboxModel : public ui::ComboboxModel {
return num_certs;
}
virtual string16 GetItemAt(int combo_index) {
- if (!cert_library_->CertificatesLoaded())
+ if (cert_library_->CertificatesLoading())
return l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING);
if (cert_library_->GetUserCertificates().Size() == 0)
@@ -385,7 +385,7 @@ void WifiConfigView::RefreshEapFields() {
passphrase_textfield_->SetText(string16());
// User certs only for EAP-TLS
- bool certs_loading = !cert_library_->CertificatesLoaded();
+ bool certs_loading = cert_library_->CertificatesLoading();
bool user_cert_enabled = (selected == EAP_METHOD_INDEX_TLS);
user_cert_label_->SetEnabled(user_cert_enabled);
bool have_user_certs = !certs_loading && HaveUserCerts();