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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "chrome/browser/content_settings/content_settings_usages_state.h" 15 #include "chrome/browser/content_settings/content_settings_usages_state.h"
16 #include "chrome/browser/content_settings/local_shared_objects_container.h" 16 #include "chrome/browser/content_settings/local_shared_objects_container.h"
17 #include "chrome/browser/media/media_stream_devices_controller.h" 17 #include "chrome/browser/media/media_stream_devices_controller.h"
18 #include "chrome/browser/password_manager/password_form_manager.h"
18 #include "chrome/common/content_settings.h" 19 #include "chrome/common/content_settings.h"
19 #include "chrome/common/content_settings_types.h" 20 #include "chrome/common/content_settings_types.h"
20 #include "chrome/common/custom_handlers/protocol_handler.h" 21 #include "chrome/common/custom_handlers/protocol_handler.h"
21 #include "content/public/browser/notification_observer.h" 22 #include "content/public/browser/notification_observer.h"
22 #include "content/public/browser/notification_registrar.h" 23 #include "content/public/browser/notification_registrar.h"
23 #include "content/public/browser/web_contents_observer.h" 24 #include "content/public/browser/web_contents_observer.h"
24 #include "content/public/browser/web_contents_user_data.h" 25 #include "content/public/browser/web_contents_user_data.h"
25 #include "content/public/common/media_stream_request.h" 26 #include "content/public/common/media_stream_request.h"
26 #include "net/cookies/canonical_cookie.h" 27 #include "net/cookies/canonical_cookie.h"
27 28
28 class CookiesTreeModel; 29 class CookiesTreeModel;
29 class PasswordFormManager;
30 class Profile; 30 class Profile;
31 31
32 namespace content { 32 namespace content {
33 class RenderViewHost; 33 class RenderViewHost;
34 } 34 }
35 35
36 namespace net { 36 namespace net {
37 class CookieOptions; 37 class CookieOptions;
38 } 38 }
39 39
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 int64 frame_id, 288 int64 frame_id,
289 int64 parent_frame_id, 289 int64 parent_frame_id,
290 bool is_main_frame, 290 bool is_main_frame,
291 const GURL& validated_url, 291 const GURL& validated_url,
292 bool is_error_page, 292 bool is_error_page,
293 bool is_iframe_srcdoc, 293 bool is_iframe_srcdoc,
294 content::RenderViewHost* render_view_host) OVERRIDE; 294 content::RenderViewHost* render_view_host) OVERRIDE;
295 virtual void AppCacheAccessed(const GURL& manifest_url, 295 virtual void AppCacheAccessed(const GURL& manifest_url,
296 bool blocked_by_policy) OVERRIDE; 296 bool blocked_by_policy) OVERRIDE;
297 297
298 // If user clicks on 'save password' this will have the password saved upon 298 // Called when the user chooses to save or blacklist a password. Instructs
299 // the next navigation. 299 // |form_manager_| to perfom the chosen action when the next navigation
300 bool PasswordAccepted(); 300 // occurs or when the tab is closed. The change isn't applied immediately
301 301 // because the user can still recall the UI and change the desired action,
302 // If user clicks on 'never save password for this site' this have the 302 // until the next navigation, and undoing a blacklist operation is
303 // password blacklisted upon the next navigation. 303 // nontrivial.
304 bool PasswordFormBlacklisted(); 304 void set_password_action(
305 PasswordFormManager::PasswordAction password_action) {
306 DCHECK(form_manager_.get());
307 form_manager_->set_password_action(password_action);
308 }
305 309
306 // Message handlers. Public for testing. 310 // Message handlers. Public for testing.
307 void OnContentBlocked(ContentSettingsType type, 311 void OnContentBlocked(ContentSettingsType type,
308 const std::string& resource_identifier); 312 const std::string& resource_identifier);
309 void OnContentAllowed(ContentSettingsType type); 313 void OnContentAllowed(ContentSettingsType type);
310 314
311 // These methods are invoked on the UI thread by the static functions above. 315 // These methods are invoked on the UI thread by the static functions above.
312 // Public for testing. 316 // Public for testing.
313 void OnCookiesRead(const GURL& url, 317 void OnCookiesRead(const GURL& url,
314 const GURL& first_party_url, 318 const GURL& first_party_url,
(...skipping 20 matching lines...) Expand all
335 bool allowed); 339 bool allowed);
336 340
337 // This method is called to update the status about the microphone and 341 // This method is called to update the status about the microphone and
338 // camera stream access. |request_permissions| contains a list of requested 342 // camera stream access. |request_permissions| contains a list of requested
339 // media stream types and the permission for each type. 343 // media stream types and the permission for each type.
340 void OnMediaStreamPermissionSet( 344 void OnMediaStreamPermissionSet(
341 const GURL& request_origin, 345 const GURL& request_origin,
342 const MediaStreamDevicesController::MediaStreamTypePermissionMap& 346 const MediaStreamDevicesController::MediaStreamTypePermissionMap&
343 request_permissions); 347 request_permissions);
344 348
345 // This method is called to pass the |form_to_save| on a successful password 349 // Called when the user submits a form containing login information, so we
346 // submission. It also updates the status of the save password content 350 // can handle later requests to save or blacklist that login information.
347 // setting. 351 // This stores the provided object in form_manager_ and triggers the UI to
348 void OnPasswordSubmitted(PasswordFormManager* form_to_save); 352 // prompt the user about whether they would like to save the password.
353 void OnPasswordSubmitted(PasswordFormManager* form_manager);
349 354
350 // There methods are called to update the status about MIDI access. 355 // There methods are called to update the status about MIDI access.
351 void OnMIDISysExAccessed(const GURL& reqesting_origin); 356 void OnMIDISysExAccessed(const GURL& reqesting_origin);
352 void OnMIDISysExAccessBlocked(const GURL& requesting_origin); 357 void OnMIDISysExAccessBlocked(const GURL& requesting_origin);
353 358
354 // Adds the given |SiteDataObserver|. The |observer| is notified when a 359 // Adds the given |SiteDataObserver|. The |observer| is notified when a
355 // locale shared object, like for example a cookie, is accessed. 360 // locale shared object, like for example a cookie, is accessed.
356 void AddSiteDataObserver(SiteDataObserver* observer); 361 void AddSiteDataObserver(SiteDataObserver* observer);
357 362
358 // Removes the given |SiteDataObserver|. 363 // Removes the given |SiteDataObserver|.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // Stores whether the user can load blocked plugins on this page. 426 // Stores whether the user can load blocked plugins on this page.
422 bool load_plugins_link_enabled_; 427 bool load_plugins_link_enabled_;
423 428
424 content::NotificationRegistrar registrar_; 429 content::NotificationRegistrar registrar_;
425 430
426 // The origin of the media stream request. Note that we only support handling 431 // The origin of the media stream request. Note that we only support handling
427 // settings for one request per tab. The latest request's origin will be 432 // settings for one request per tab. The latest request's origin will be
428 // stored here. http://crbug.com/259794 433 // stored here. http://crbug.com/259794
429 GURL media_stream_access_origin_; 434 GURL media_stream_access_origin_;
430 435
431 // The PasswordFormManager managing the form we're asking the user about, 436 // Set by OnPasswordSubmitted() when the user submits a form containing login
432 // and should update as per the decision. 437 // information. If the user responds to a subsequent "Do you want to save
433 scoped_ptr<PasswordFormManager> form_to_save_; 438 // this password?" prompt, we ask this object to save or blacklist the
439 // associated login information in Chrome's password store.
440 scoped_ptr<PasswordFormManager> form_manager_;
434 441
435 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); 442 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
436 }; 443 };
437 444
438 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 445 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
OLDNEW
« 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