Index: chrome/browser/ui/webui/options/password_manager_handler.cc |
diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc |
index 9a3f20a8ade15f6c5b9d7f911a117303e758f4fc..806b6f51353c21ab9ad1cb7fbdee40e442b3b53d 100644 |
--- a/chrome/browser/ui/webui/options/password_manager_handler.cc |
+++ b/chrome/browser/ui/webui/options/password_manager_handler.cc |
@@ -14,6 +14,7 @@ |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
+#include "content/browser/tab_contents/tab_contents.h" |
#include "content/common/notification_details.h" |
#include "content/common/notification_source.h" |
#include "grit/chromium_strings.h" |
@@ -83,8 +84,10 @@ void PasswordManagerHandler::Initialize() { |
if (!show_passwords_.GetPrefName().empty()) |
return; |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
show_passwords_.Init(prefs::kPasswordManagerAllowShowPasswords, |
- web_ui_->GetProfile()->GetPrefs(), this); |
+ profile->GetPrefs(), this); |
// We should not cache web_ui_->GetProfile(). See crosbug.com/6304. |
PasswordStore* store = GetPasswordStore(); |
if (store) |
@@ -111,7 +114,9 @@ void PasswordManagerHandler::OnLoginsChanged() { |
} |
PasswordStore* PasswordManagerHandler::GetPasswordStore() { |
- return web_ui_->GetProfile()->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ return profile->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
} |
void PasswordManagerHandler::Observe(int type, |
@@ -132,8 +137,9 @@ void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) { |
password_list_.reset(); |
password_exception_list_.reset(); |
- languages_ = |
- web_ui_->GetProfile()->GetPrefs()->GetString(prefs::kAcceptLanguages); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ languages_ = profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
populater_.Populate(); |
exception_populater_.Populate(); |
} |