OLD | NEW |
---|---|
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 Loading... | |
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 occurs |
300 bool PasswordAccepted(); | 300 // or when the tab is closed. |
Peter Kasting
2013/09/12 20:21:00
So why is it that we do set_password_action() and
npentrel
2013/09/13 08:31:26
First of all, you are right the UI disappears once
Peter Kasting
2013/09/13 17:04:40
Thanks, this is a great explanation.
Perhaps this
| |
301 | 301 void set_password_action( |
302 // If user clicks on 'never save password for this site' this have the | 302 PasswordFormManager::PasswordAction password_action) { |
303 // password blacklisted upon the next navigation. | 303 DCHECK(form_manager_.get()); |
304 bool PasswordFormBlacklisted(); | 304 form_manager_->set_password_action(password_action); |
305 } | |
305 | 306 |
306 // Message handlers. Public for testing. | 307 // Message handlers. Public for testing. |
307 void OnContentBlocked(ContentSettingsType type, | 308 void OnContentBlocked(ContentSettingsType type, |
308 const std::string& resource_identifier); | 309 const std::string& resource_identifier); |
309 void OnContentAllowed(ContentSettingsType type); | 310 void OnContentAllowed(ContentSettingsType type); |
310 | 311 |
311 // These methods are invoked on the UI thread by the static functions above. | 312 // These methods are invoked on the UI thread by the static functions above. |
312 // Public for testing. | 313 // Public for testing. |
313 void OnCookiesRead(const GURL& url, | 314 void OnCookiesRead(const GURL& url, |
314 const GURL& first_party_url, | 315 const GURL& first_party_url, |
(...skipping 20 matching lines...) Expand all Loading... | |
335 bool allowed); | 336 bool allowed); |
336 | 337 |
337 // This method is called to update the status about the microphone and | 338 // This method is called to update the status about the microphone and |
338 // camera stream access. |request_permissions| contains a list of requested | 339 // camera stream access. |request_permissions| contains a list of requested |
339 // media stream types and the permission for each type. | 340 // media stream types and the permission for each type. |
340 void OnMediaStreamPermissionSet( | 341 void OnMediaStreamPermissionSet( |
341 const GURL& request_origin, | 342 const GURL& request_origin, |
342 const MediaStreamDevicesController::MediaStreamTypePermissionMap& | 343 const MediaStreamDevicesController::MediaStreamTypePermissionMap& |
343 request_permissions); | 344 request_permissions); |
344 | 345 |
345 // This method is called to pass the |form_to_save| on a successful password | 346 // Called when a password form is submitted. |form_manager| is the submitted |
346 // submission. It also updates the status of the save password content | 347 // form. This form can save or blacklist the login credentials. For that the |
347 // setting. | 348 // state |passsowrd_action_| needs to be set accordingly and then applied by |
348 void OnPasswordSubmitted(PasswordFormManager* form_to_save); | 349 // PasswordFormManager::ApplyChange(). |
Peter Kasting
2013/09/12 20:21:00
Spelling and clarity issues. How about:
Called w
npentrel
2013/09/13 08:31:26
Done.
| |
350 void OnPasswordSubmitted(PasswordFormManager* form_manager); | |
349 | 351 |
350 // There methods are called to update the status about MIDI access. | 352 // There methods are called to update the status about MIDI access. |
351 void OnMIDISysExAccessed(const GURL& reqesting_origin); | 353 void OnMIDISysExAccessed(const GURL& reqesting_origin); |
352 void OnMIDISysExAccessBlocked(const GURL& requesting_origin); | 354 void OnMIDISysExAccessBlocked(const GURL& requesting_origin); |
353 | 355 |
354 // Adds the given |SiteDataObserver|. The |observer| is notified when a | 356 // Adds the given |SiteDataObserver|. The |observer| is notified when a |
355 // locale shared object, like for example a cookie, is accessed. | 357 // locale shared object, like for example a cookie, is accessed. |
356 void AddSiteDataObserver(SiteDataObserver* observer); | 358 void AddSiteDataObserver(SiteDataObserver* observer); |
357 | 359 |
358 // Removes the given |SiteDataObserver|. | 360 // Removes the given |SiteDataObserver|. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 bool load_plugins_link_enabled_; | 424 bool load_plugins_link_enabled_; |
423 | 425 |
424 content::NotificationRegistrar registrar_; | 426 content::NotificationRegistrar registrar_; |
425 | 427 |
426 // The origin of the media stream request. Note that we only support handling | 428 // 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 | 429 // settings for one request per tab. The latest request's origin will be |
428 // stored here. http://crbug.com/259794 | 430 // stored here. http://crbug.com/259794 |
429 GURL media_stream_access_origin_; | 431 GURL media_stream_access_origin_; |
430 | 432 |
431 // The PasswordFormManager managing the form we're asking the user about, | 433 // The PasswordFormManager managing the form we're asking the user about, |
432 // and should update as per the decision. | 434 // and should update as per the decision. |
Peter Kasting
2013/09/12 20:21:00
This sentence is not grammatically correct. How a
npentrel
2013/09/13 08:31:26
Done.
| |
433 scoped_ptr<PasswordFormManager> form_to_save_; | 435 scoped_ptr<PasswordFormManager> form_manager_; |
434 | 436 |
435 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 437 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
436 }; | 438 }; |
437 | 439 |
438 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 440 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |