Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5653)

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.h

Issue 23537029: Save password functionality added to the save password bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review 5 Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/content_settings/tab_specific_content_settings.h
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h
index 28943430d873e5126cd22ab7b8c597e752231822..e9b06f390aedc2b8e91f733d098d67f3306c285a 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.h
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h
@@ -15,6 +15,7 @@
#include "chrome/browser/content_settings/content_settings_usages_state.h"
#include "chrome/browser/content_settings/local_shared_objects_container.h"
#include "chrome/browser/media/media_stream_devices_controller.h"
+#include "chrome/browser/password_manager/password_form_manager.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/custom_handlers/protocol_handler.h"
@@ -26,7 +27,6 @@
#include "net/cookies/canonical_cookie.h"
class CookiesTreeModel;
-class PasswordFormManager;
class Profile;
namespace content {
@@ -295,13 +295,17 @@ class TabSpecificContentSettings
virtual void AppCacheAccessed(const GURL& manifest_url,
bool blocked_by_policy) OVERRIDE;
- // If user clicks on 'save password' this will have the password saved upon
- // the next navigation.
- bool PasswordAccepted();
-
- // If user clicks on 'never save password for this site' this have the
- // password blacklisted upon the next navigation.
- bool PasswordFormBlacklisted();
+ // Called when the user chooses to save or blacklist a password. Instructs
+ // |form_manager_| to perfom the chosen action when the next navigation
+ // occurs or when the tab is closed. The change isn't applied immediately
+ // because the user can still recall the UI and change the desired action,
+ // until the next navigation, and undoing a blacklist operation is
+ // nontrivial.
+ void set_password_action(
+ PasswordFormManager::PasswordAction password_action) {
+ DCHECK(form_manager_.get());
+ form_manager_->set_password_action(password_action);
+ }
// Message handlers. Public for testing.
void OnContentBlocked(ContentSettingsType type,
@@ -342,10 +346,11 @@ class TabSpecificContentSettings
const MediaStreamDevicesController::MediaStreamTypePermissionMap&
request_permissions);
- // This method is called to pass the |form_to_save| on a successful password
- // submission. It also updates the status of the save password content
- // setting.
- void OnPasswordSubmitted(PasswordFormManager* form_to_save);
+ // Called when the user submits a form containing login information, so we
+ // can handle later requests to save or blacklist that login information.
+ // This stores the provided object in form_manager_ and triggers the UI to
+ // prompt the user about whether they would like to save the password.
+ void OnPasswordSubmitted(PasswordFormManager* form_manager);
// There methods are called to update the status about MIDI access.
void OnMIDISysExAccessed(const GURL& reqesting_origin);
@@ -428,9 +433,11 @@ class TabSpecificContentSettings
// stored here. http://crbug.com/259794
GURL media_stream_access_origin_;
- // The PasswordFormManager managing the form we're asking the user about,
- // and should update as per the decision.
- scoped_ptr<PasswordFormManager> form_to_save_;
+ // Set by OnPasswordSubmitted() when the user submits a form containing login
+ // information. If the user responds to a subsequent "Do you want to save
+ // this password?" prompt, we ask this object to save or blacklist the
+ // associated login information in Chrome's password store.
+ scoped_ptr<PasswordFormManager> form_manager_;
DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
};
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698