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-18 18:09:36 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 18:09:36 +0000
commit59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (patch)
treeda55718682e3a4d7da3c6f3d70870eee0542d0b9 /chrome/browser/password_manager
parentd940627c90386df7844092dae635ed2f20535f28 (diff)
downloadchromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.zip
chromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.tar.gz
chromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.tar.bz2
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. Review URL: http://codereview.chromium.org/69043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14005 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;