summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 20:19:00 +0000
committercmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 20:19:00 +0000
commit87c23d51618a288127eed63419e4f26d770f74c5 (patch)
treee61ded0253b98944629d372f4e3a5fecab762260
parent1cc7e730535abf1d6a96d53d2cfa372c9bcb7291 (diff)
downloadchromium_src-87c23d51618a288127eed63419e4f26d770f74c5.zip
chromium_src-87c23d51618a288127eed63419e4f26d770f74c5.tar.gz
chromium_src-87c23d51618a288127eed63419e4f26d770f74c5.tar.bz2
[Chrome OS] ensure owner key is found after crash, if user is owner
BUG=chromium-os:6687 TEST=unit tests, put on device and check Review URL: http://codereview.chromium.org/3452009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59837 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc30
-rw-r--r--chrome/browser/chromeos/login/user_manager.cc3
2 files changed, 6 insertions, 27 deletions
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 93786b7..ad0dd11 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -8,7 +8,6 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/lock.h"
-#include "base/nss_util.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
@@ -35,10 +34,6 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/net/url_request_context_getter.h"
-#include "chrome/common/notification_observer.h"
-#include "chrome/common/notification_registrar.h"
-#include "chrome/common/notification_service.h"
-#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
#include "googleurl/src/gurl.h"
#include "net/base/cookie_store.h"
@@ -57,15 +52,10 @@ const char kAuthSuffix[] = "\n";
} // namespace
-class LoginUtilsImpl : public LoginUtils,
- public NotificationObserver {
+class LoginUtilsImpl : public LoginUtils {
public:
LoginUtilsImpl()
: browser_launch_enabled_(true) {
- registrar_.Add(
- this,
- NotificationType::LOGIN_USER_CHANGED,
- NotificationService::AllSources());
}
// Invoked after the user has successfully logged in. This launches a browser
@@ -91,14 +81,7 @@ class LoginUtilsImpl : public LoginUtils,
// Returns auth token for 'cp' Contacts service.
virtual const std::string& GetAuthToken() const { return auth_token_; }
- // NotificationObserver implementation.
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
private:
- NotificationRegistrar registrar_;
-
// Indicates if DoBrowserLaunch will actually launch the browser or not.
bool browser_launch_enabled_;
@@ -204,10 +187,10 @@ void LoginUtilsImpl::CompleteLogin(const std::string& username,
if (locale != kFallbackInputMethodLocale) {
StringPrefMember language_preload_engines;
language_preload_engines.Init(prefs::kLanguagePreloadEngines,
- profile->GetPrefs(), this);
+ profile->GetPrefs(), NULL);
StringPrefMember language_preferred_languages;
language_preferred_languages.Init(prefs::kLanguagePreferredLanguages,
- profile->GetPrefs(), this);
+ profile->GetPrefs(), NULL);
std::string preload_engines(language_preload_engines.GetValue());
std::vector<std::string> input_method_ids;
@@ -279,13 +262,6 @@ bool LoginUtilsImpl::IsBrowserLaunchEnabled() const {
return browser_launch_enabled_;
}
-void LoginUtilsImpl::Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- if (type == NotificationType::LOGIN_USER_CHANGED)
- base::OpenPersistentNSSDB();
-}
-
LoginUtils* LoginUtils::Get() {
return Singleton<LoginUtilsWrapper>::get()->get();
}
diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc
index 3336622..584370a 100644
--- a/chrome/browser/chromeos/login/user_manager.cc
+++ b/chrome/browser/chromeos/login/user_manager.cc
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/nss_util.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/time.h"
@@ -275,6 +276,8 @@ void UserManager::NotifyOnLogin() {
StopInputMethodProcesses();
// Let the window manager know that we're logged in now.
WmIpc::instance()->SetLoggedInProperty(true);
+ // Ensure we've opened the real user's key/certificate database.
+ base::OpenPersistentNSSDB();
// Schedules current user ownership check on file thread.
ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,