| 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 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 #endif | 1906 #endif |
| 1907 break; | 1907 break; |
| 1908 case content::PERMISSION_GEOLOCATION: | 1908 case content::PERMISSION_GEOLOCATION: |
| 1909 GeolocationPermissionContextFactory::GetForProfile(profile) | 1909 GeolocationPermissionContextFactory::GetForProfile(profile) |
| 1910 ->RequestPermission(web_contents, | 1910 ->RequestPermission(web_contents, |
| 1911 request_id, | 1911 request_id, |
| 1912 requesting_frame.GetOrigin(), | 1912 requesting_frame.GetOrigin(), |
| 1913 user_gesture, | 1913 user_gesture, |
| 1914 result_callback); | 1914 result_callback); |
| 1915 break; | 1915 break; |
| 1916 case content::PERMISSION_PROTECTED_MEDIA: | 1916 case content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER: |
| 1917 #if defined(OS_ANDROID) | 1917 #if defined(OS_ANDROID) |
| 1918 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) | 1918 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) |
| 1919 ->RequestPermission(web_contents, | 1919 ->RequestPermission(web_contents, |
| 1920 request_id, | 1920 request_id, |
| 1921 requesting_frame.GetOrigin(), | 1921 requesting_frame.GetOrigin(), |
| 1922 user_gesture, | 1922 user_gesture, |
| 1923 result_callback); | 1923 result_callback); |
| 1924 #else | 1924 #else |
| 1925 NOTIMPLEMENTED(); | 1925 NOTIMPLEMENTED(); |
| 1926 #endif | 1926 #endif |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1955 case content::PERMISSION_NOTIFICATIONS: | 1955 case content::PERMISSION_NOTIFICATIONS: |
| 1956 #if defined(ENABLE_NOTIFICATIONS) | 1956 #if defined(ENABLE_NOTIFICATIONS) |
| 1957 context = DesktopNotificationServiceFactory::GetForProfile(profile); | 1957 context = DesktopNotificationServiceFactory::GetForProfile(profile); |
| 1958 #else | 1958 #else |
| 1959 NOTIMPLEMENTED(); | 1959 NOTIMPLEMENTED(); |
| 1960 #endif | 1960 #endif |
| 1961 break; | 1961 break; |
| 1962 case content::PERMISSION_GEOLOCATION: | 1962 case content::PERMISSION_GEOLOCATION: |
| 1963 context = GeolocationPermissionContextFactory::GetForProfile(profile); | 1963 context = GeolocationPermissionContextFactory::GetForProfile(profile); |
| 1964 break; | 1964 break; |
| 1965 case content::PERMISSION_PROTECTED_MEDIA: | 1965 case content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER: |
| 1966 #if defined(OS_ANDROID) | 1966 #if defined(OS_ANDROID) |
| 1967 context = ProtectedMediaIdentifierPermissionContextFactory::GetForProfile( | 1967 context = ProtectedMediaIdentifierPermissionContextFactory::GetForProfile( |
| 1968 profile); | 1968 profile); |
| 1969 #else | 1969 #else |
| 1970 NOTIMPLEMENTED(); | 1970 NOTIMPLEMENTED(); |
| 1971 #endif | 1971 #endif |
| 1972 break; | 1972 break; |
| 1973 case content::PERMISSION_PUSH_MESSAGING: | 1973 case content::PERMISSION_PUSH_MESSAGING: |
| 1974 context = gcm::PushMessagingPermissionContextFactory::GetForProfile( | 1974 context = gcm::PushMessagingPermissionContextFactory::GetForProfile( |
| 1975 profile); | 1975 profile); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 DesktopNotificationServiceFactory::GetForProfile(profile) | 2011 DesktopNotificationServiceFactory::GetForProfile(profile) |
| 2012 ->CancelPermissionRequest(web_contents, request_id); | 2012 ->CancelPermissionRequest(web_contents, request_id); |
| 2013 #else | 2013 #else |
| 2014 NOTIMPLEMENTED(); | 2014 NOTIMPLEMENTED(); |
| 2015 #endif | 2015 #endif |
| 2016 break; | 2016 break; |
| 2017 case content::PERMISSION_GEOLOCATION: | 2017 case content::PERMISSION_GEOLOCATION: |
| 2018 GeolocationPermissionContextFactory::GetForProfile(profile) | 2018 GeolocationPermissionContextFactory::GetForProfile(profile) |
| 2019 ->CancelPermissionRequest(web_contents, request_id); | 2019 ->CancelPermissionRequest(web_contents, request_id); |
| 2020 break; | 2020 break; |
| 2021 case content::PERMISSION_PROTECTED_MEDIA: | 2021 case content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER: |
| 2022 #if defined(OS_ANDROID) | 2022 #if defined(OS_ANDROID) |
| 2023 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) | 2023 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) |
| 2024 ->CancelPermissionRequest(web_contents, request_id); | 2024 ->CancelPermissionRequest(web_contents, request_id); |
| 2025 #else | 2025 #else |
| 2026 NOTIMPLEMENTED(); | 2026 NOTIMPLEMENTED(); |
| 2027 #endif | 2027 #endif |
| 2028 break; | 2028 break; |
| 2029 case content::PERMISSION_PUSH_MESSAGING: | 2029 case content::PERMISSION_PUSH_MESSAGING: |
| 2030 NOTIMPLEMENTED() << "CancelPermission not implemented for " << permission; | 2030 NOTIMPLEMENTED() << "CancelPermission not implemented for " << permission; |
| 2031 break; | 2031 break; |
| 2032 case content::PERMISSION_NUM: | 2032 case content::PERMISSION_NUM: |
| 2033 NOTREACHED() << "Invalid CancelPermission for " << permission; | 2033 NOTREACHED() << "Invalid CancelPermission for " << permission; |
| 2034 break; | 2034 break; |
| 2035 } | 2035 } |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 // Helper method to translate from Permissions to ContentSettings | 2038 // Helper method to translate from Permissions to ContentSettings |
| 2039 static ContentSettingsType PermissionToContentSetting( | 2039 static ContentSettingsType PermissionToContentSetting( |
| 2040 content::PermissionType permission) { | 2040 content::PermissionType permission) { |
| 2041 switch (permission) { | 2041 switch (permission) { |
| 2042 case content::PERMISSION_MIDI_SYSEX: | 2042 case content::PERMISSION_MIDI_SYSEX: |
| 2043 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; | 2043 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; |
| 2044 case content::PERMISSION_PUSH_MESSAGING: | 2044 case content::PERMISSION_PUSH_MESSAGING: |
| 2045 return CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; | 2045 return CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; |
| 2046 case content::PERMISSION_NOTIFICATIONS: | 2046 case content::PERMISSION_NOTIFICATIONS: |
| 2047 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; | 2047 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
| 2048 case content::PERMISSION_GEOLOCATION: | 2048 case content::PERMISSION_GEOLOCATION: |
| 2049 return CONTENT_SETTINGS_TYPE_GEOLOCATION; | 2049 return CONTENT_SETTINGS_TYPE_GEOLOCATION; |
| 2050 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 2050 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 2051 case content::PERMISSION_PROTECTED_MEDIA: | 2051 case content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER: |
| 2052 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; | 2052 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; |
| 2053 #endif | 2053 #endif |
| 2054 default: | 2054 default: |
| 2055 NOTREACHED() << "Unknown content setting for permission " << permission; | 2055 NOTREACHED() << "Unknown content setting for permission " << permission; |
| 2056 return CONTENT_SETTINGS_TYPE_DEFAULT; | 2056 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 2057 } | 2057 } |
| 2058 } | 2058 } |
| 2059 | 2059 |
| 2060 void ChromeContentBrowserClient::RegisterPermissionUsage( | 2060 void ChromeContentBrowserClient::RegisterPermissionUsage( |
| 2061 content::PermissionType permission, | 2061 content::PermissionType permission, |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 switches::kDisableWebRtcEncryption, | 2647 switches::kDisableWebRtcEncryption, |
| 2648 }; | 2648 }; |
| 2649 to_command_line->CopySwitchesFrom(from_command_line, | 2649 to_command_line->CopySwitchesFrom(from_command_line, |
| 2650 kWebRtcDevSwitchNames, | 2650 kWebRtcDevSwitchNames, |
| 2651 arraysize(kWebRtcDevSwitchNames)); | 2651 arraysize(kWebRtcDevSwitchNames)); |
| 2652 } | 2652 } |
| 2653 } | 2653 } |
| 2654 #endif // defined(ENABLE_WEBRTC) | 2654 #endif // defined(ENABLE_WEBRTC) |
| 2655 | 2655 |
| 2656 } // namespace chrome | 2656 } // namespace chrome |
| OLD | NEW |