summaryrefslogtreecommitdiffstats
path: root/chrome/browser/password_manager
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 19:55:57 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 19:55:57 +0000
commitce3fa3c831cba1f44d34c1c66020f830be33a068 (patch)
treeda18dbdfb081c17949dca2dcfa0633142a63a868 /chrome/browser/password_manager
parent6ee6368c466235c5919c9b4d5cfe11f8e48b29ca (diff)
downloadchromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.zip
chromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.tar.gz
chromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.tar.bz2
Re-land my change to clean up TabContents/WebContents ownership. This
is the same except in tab_strip_model_unittest I fixed a leak by making a WebContents on the stack, I added a factory to the SiteInstance unittest to prevent another leak, and I re-added a NULL set to the external_tab_container. Fix the ownership model of TabContents and NavigationController. Previously the NavigationController owned the TabContents, and there were extra steps required at creation and destruction to clean everything up properly. NavigationController is now a member of TabContents, and there is no setup or tear down necessary other than the constructor and destructor. I could remove the tab contents creation in the NavigationController, as well as all the weird destruction code in WebContents which got moved to the destructor. I made the controller getter return a reference since the ownership is clear and there is no possibility of NULL. This required changing a lot of tiles, but many of them were simplified since they no longer have to NULL check. Previous review URL: http://codereview.chromium.org/69043 Review URL: http://codereview.chromium.org/67294 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager')
-rw-r--r--chrome/browser/password_manager/password_manager.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc
index 769c08e..2144806 100644
--- a/chrome/browser/password_manager/password_manager.cc
+++ b/chrome/browser/password_manager/password_manager.cc
@@ -98,8 +98,9 @@ PasswordManager::~PasswordManager() {
}
void PasswordManager::ProvisionallySavePassword(PasswordForm form) {
- if (!web_contents_->controller() || !web_contents_->profile() ||
- web_contents_->profile()->IsOffTheRecord() || !*password_manager_enabled_)
+ if (!web_contents_->profile() ||
+ web_contents_->profile()->IsOffTheRecord() ||
+ !*password_manager_enabled_)
return;
// No password to save? Then don't.
@@ -134,7 +135,7 @@ void PasswordManager::ProvisionallySavePassword(PasswordForm form) {
return;
form.ssl_valid = form.origin.SchemeIsSecure() &&
- !web_contents_->controller()->ssl_manager()->
+ !web_contents_->controller().ssl_manager()->
ProcessedSSLErrorFromRequest();
form.preferred = true;
manager->ProvisionallySave(form);
@@ -166,9 +167,6 @@ void PasswordManager::DidStopLoading() {
if (!web_contents_->profile() ||
!web_contents_->profile()->GetWebDataService(Profile::IMPLICIT_ACCESS))
return;
- if (!web_contents_->controller())
- return;
-
if (provisional_save_manager_->IsNewLogin()) {
web_contents_->AddInfoBar(
new SavePasswordInfoBarDelegate(web_contents_,
@@ -186,13 +184,11 @@ void PasswordManager::PasswordFormsSeen(
if (!web_contents_->profile() ||
!web_contents_->profile()->GetWebDataService(Profile::EXPLICIT_ACCESS))
return;
- if (!web_contents_->controller())
- return;
if (!*password_manager_enabled_)
return;
// Ask the SSLManager for current security.
- bool had_ssl_error = web_contents_->controller()->ssl_manager()->
+ bool had_ssl_error = web_contents_->controller().ssl_manager()->
ProcessedSSLErrorFromRequest();
std::vector<PasswordForm>::const_iterator iter;