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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1858 | 1858 |
1859 blink::WebNotificationPermission | 1859 blink::WebNotificationPermission |
1860 ChromeContentBrowserClient::CheckDesktopNotificationPermission( | 1860 ChromeContentBrowserClient::CheckDesktopNotificationPermission( |
1861 const GURL& source_origin, | 1861 const GURL& source_origin, |
1862 content::ResourceContext* context, | 1862 content::ResourceContext* context, |
1863 int render_process_id) { | 1863 int render_process_id) { |
1864 #if defined(ENABLE_NOTIFICATIONS) | 1864 #if defined(ENABLE_NOTIFICATIONS) |
1865 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1865 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1866 | 1866 |
1867 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 1867 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
1868 #if defined(ENABLED_EXTENSIONS) | |
Jun Mukai
2014/09/22 05:53:16
ENABLE_EXTENSIONS
not ENABLED
Jitu( very slow this week)
2014/09/22 05:56:57
Done.
Thanks
| |
1868 InfoMap* extension_info_map = io_data->GetExtensionInfoMap(); | 1869 InfoMap* extension_info_map = io_data->GetExtensionInfoMap(); |
1869 | 1870 |
1870 // We want to see if there is an extension that hasn't been manually disabled | 1871 // We want to see if there is an extension that hasn't been manually disabled |
1871 // that has the notifications permission and applies to this security origin. | 1872 // that has the notifications permission and applies to this security origin. |
1872 // First, get the list of extensions with permission for the origin. | 1873 // First, get the list of extensions with permission for the origin. |
1873 extensions::ExtensionSet extensions; | 1874 extensions::ExtensionSet extensions; |
1874 extension_info_map->GetExtensionsWithAPIPermissionForSecurityOrigin( | 1875 extension_info_map->GetExtensionsWithAPIPermissionForSecurityOrigin( |
1875 source_origin, | 1876 source_origin, |
1876 render_process_id, | 1877 render_process_id, |
1877 extensions::APIPermission::kNotifications, | 1878 extensions::APIPermission::kNotifications, |
1878 &extensions); | 1879 &extensions); |
1879 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); | 1880 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); |
1880 iter != extensions.end(); ++iter) { | 1881 iter != extensions.end(); ++iter) { |
1881 // Then, check to see if it's been disabled by the user. | 1882 // Then, check to see if it's been disabled by the user. |
1882 if (!extension_info_map->AreNotificationsDisabled((*iter)->id())) | 1883 if (!extension_info_map->AreNotificationsDisabled((*iter)->id())) |
1883 return blink::WebNotificationPermissionAllowed; | 1884 return blink::WebNotificationPermissionAllowed; |
1884 } | 1885 } |
1886 #endif | |
1885 | 1887 |
1886 // No enabled extensions exist, so check the normal host content settings. | 1888 // No enabled extensions exist, so check the normal host content settings. |
1887 HostContentSettingsMap* host_content_settings_map = | 1889 HostContentSettingsMap* host_content_settings_map = |
1888 io_data->GetHostContentSettingsMap(); | 1890 io_data->GetHostContentSettingsMap(); |
1889 ContentSetting setting = host_content_settings_map->GetContentSetting( | 1891 ContentSetting setting = host_content_settings_map->GetContentSetting( |
1890 source_origin, | 1892 source_origin, |
1891 source_origin, | 1893 source_origin, |
1892 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 1894 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
1893 NO_RESOURCE_IDENTIFIER); | 1895 NO_RESOURCE_IDENTIFIER); |
1894 | 1896 |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2591 switches::kDisableWebRtcEncryption, | 2593 switches::kDisableWebRtcEncryption, |
2592 }; | 2594 }; |
2593 to_command_line->CopySwitchesFrom(from_command_line, | 2595 to_command_line->CopySwitchesFrom(from_command_line, |
2594 kWebRtcDevSwitchNames, | 2596 kWebRtcDevSwitchNames, |
2595 arraysize(kWebRtcDevSwitchNames)); | 2597 arraysize(kWebRtcDevSwitchNames)); |
2596 } | 2598 } |
2597 } | 2599 } |
2598 #endif // defined(ENABLE_WEBRTC) | 2600 #endif // defined(ENABLE_WEBRTC) |
2599 | 2601 |
2600 } // namespace chrome | 2602 } // namespace chrome |
OLD | NEW |