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 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
28 #include "content/public/browser/navigation_controller.h" | 28 #include "content/public/browser/navigation_controller.h" |
29 #include "content/public/browser/navigation_details.h" | 29 #include "content/public/browser/navigation_details.h" |
30 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
32 #include "content/public/browser/render_frame_host.h" | 32 #include "content/public/browser/render_frame_host.h" |
33 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
35 #include "content/public/browser/web_contents_delegate.h" | 35 #include "content/public/browser/web_contents_delegate.h" |
36 #include "net/cookies/canonical_cookie.h" | 36 #include "net/cookies/canonical_cookie.h" |
37 #include "webkit/common/fileapi/file_system_types.h" | 37 #include "storage/common/fileapi/file_system_types.h" |
38 | 38 |
39 using content::BrowserThread; | 39 using content::BrowserThread; |
40 using content::NavigationController; | 40 using content::NavigationController; |
41 using content::NavigationEntry; | 41 using content::NavigationEntry; |
42 using content::RenderViewHost; | 42 using content::RenderViewHost; |
43 using content::WebContents; | 43 using content::WebContents; |
44 | 44 |
45 DEFINE_WEB_CONTENTS_USER_DATA_KEY(TabSpecificContentSettings); | 45 DEFINE_WEB_CONTENTS_USER_DATA_KEY(TabSpecificContentSettings); |
46 | 46 |
47 TabSpecificContentSettings::SiteDataObserver::SiteDataObserver( | 47 TabSpecificContentSettings::SiteDataObserver::SiteDataObserver( |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); | 435 OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); |
436 } | 436 } |
437 | 437 |
438 NotifySiteDataObservers(); | 438 NotifySiteDataObservers(); |
439 } | 439 } |
440 | 440 |
441 void TabSpecificContentSettings::OnFileSystemAccessed( | 441 void TabSpecificContentSettings::OnFileSystemAccessed( |
442 const GURL& url, | 442 const GURL& url, |
443 bool blocked_by_policy) { | 443 bool blocked_by_policy) { |
444 if (blocked_by_policy) { | 444 if (blocked_by_policy) { |
445 blocked_local_shared_objects_.file_systems()->AddFileSystem(url, | 445 blocked_local_shared_objects_.file_systems()->AddFileSystem( |
446 fileapi::kFileSystemTypeTemporary, 0); | 446 url, storage::kFileSystemTypeTemporary, 0); |
447 OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES); | 447 OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES); |
448 } else { | 448 } else { |
449 allowed_local_shared_objects_.file_systems()->AddFileSystem(url, | 449 allowed_local_shared_objects_.file_systems()->AddFileSystem( |
450 fileapi::kFileSystemTypeTemporary, 0); | 450 url, storage::kFileSystemTypeTemporary, 0); |
451 OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); | 451 OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); |
452 } | 452 } |
453 | 453 |
454 NotifySiteDataObservers(); | 454 NotifySiteDataObservers(); |
455 } | 455 } |
456 | 456 |
457 void TabSpecificContentSettings::OnGeolocationPermissionSet( | 457 void TabSpecificContentSettings::OnGeolocationPermissionSet( |
458 const GURL& requesting_origin, | 458 const GURL& requesting_origin, |
459 bool allowed) { | 459 bool allowed) { |
460 geolocation_usages_state_.OnPermissionSet(requesting_origin, allowed); | 460 geolocation_usages_state_.OnPermissionSet(requesting_origin, allowed); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 } | 720 } |
721 | 721 |
722 void TabSpecificContentSettings::RemoveSiteDataObserver( | 722 void TabSpecificContentSettings::RemoveSiteDataObserver( |
723 SiteDataObserver* observer) { | 723 SiteDataObserver* observer) { |
724 observer_list_.RemoveObserver(observer); | 724 observer_list_.RemoveObserver(observer); |
725 } | 725 } |
726 | 726 |
727 void TabSpecificContentSettings::NotifySiteDataObservers() { | 727 void TabSpecificContentSettings::NotifySiteDataObservers() { |
728 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); | 728 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); |
729 } | 729 } |
OLD | NEW |