| 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 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 GeolocationPermissionContextFactory::GetForProfile(profile) | 1890 GeolocationPermissionContextFactory::GetForProfile(profile) |
| 1891 ->RequestPermission(web_contents, | 1891 ->RequestPermission(web_contents, |
| 1892 request_id, | 1892 request_id, |
| 1893 requesting_frame.GetOrigin(), | 1893 requesting_frame.GetOrigin(), |
| 1894 user_gesture, | 1894 user_gesture, |
| 1895 result_callback); | 1895 result_callback); |
| 1896 break; | 1896 break; |
| 1897 case content::PERMISSION_PROTECTED_MEDIA: | 1897 case content::PERMISSION_PROTECTED_MEDIA: |
| 1898 #if defined(OS_ANDROID) | 1898 #if defined(OS_ANDROID) |
| 1899 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) | 1899 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) |
| 1900 ->RequestProtectedMediaIdentifierPermission( | 1900 ->RequestPermission(web_contents, |
| 1901 web_contents, requesting_frame, result_callback); | 1901 request_id, |
| 1902 requesting_frame.GetOrigin(), |
| 1903 user_gesture, |
| 1904 result_callback); |
| 1902 #else | 1905 #else |
| 1903 NOTIMPLEMENTED(); | 1906 NOTIMPLEMENTED(); |
| 1904 #endif | 1907 #endif |
| 1905 break; | 1908 break; |
| 1906 case content::PERMISSION_PUSH_MESSAGING: | 1909 case content::PERMISSION_PUSH_MESSAGING: |
| 1907 gcm::PushMessagingPermissionContextFactory::GetForProfile(profile) | 1910 gcm::PushMessagingPermissionContextFactory::GetForProfile(profile) |
| 1908 ->RequestPermission(web_contents, | 1911 ->RequestPermission(web_contents, |
| 1909 request_id, | 1912 request_id, |
| 1910 requesting_frame.GetOrigin(), | 1913 requesting_frame.GetOrigin(), |
| 1911 user_gesture, | 1914 user_gesture, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 NOTIMPLEMENTED(); | 1947 NOTIMPLEMENTED(); |
| 1945 #endif | 1948 #endif |
| 1946 break; | 1949 break; |
| 1947 case content::PERMISSION_GEOLOCATION: | 1950 case content::PERMISSION_GEOLOCATION: |
| 1948 GeolocationPermissionContextFactory::GetForProfile(profile) | 1951 GeolocationPermissionContextFactory::GetForProfile(profile) |
| 1949 ->CancelPermissionRequest(web_contents, request_id); | 1952 ->CancelPermissionRequest(web_contents, request_id); |
| 1950 break; | 1953 break; |
| 1951 case content::PERMISSION_PROTECTED_MEDIA: | 1954 case content::PERMISSION_PROTECTED_MEDIA: |
| 1952 #if defined(OS_ANDROID) | 1955 #if defined(OS_ANDROID) |
| 1953 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) | 1956 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(profile) |
| 1954 ->CancelProtectedMediaIdentifierPermissionRequests( | 1957 ->CancelPermissionRequest(web_contents, request_id); |
| 1955 render_process_id, render_view_id, requesting_frame); | |
| 1956 #else | 1958 #else |
| 1957 NOTIMPLEMENTED(); | 1959 NOTIMPLEMENTED(); |
| 1958 #endif | 1960 #endif |
| 1959 break; | 1961 break; |
| 1960 case content::PERMISSION_PUSH_MESSAGING: | 1962 case content::PERMISSION_PUSH_MESSAGING: |
| 1961 NOTIMPLEMENTED() << "CancelPermission not implemented for " << permission; | 1963 NOTIMPLEMENTED() << "CancelPermission not implemented for " << permission; |
| 1962 break; | 1964 break; |
| 1963 case content::PERMISSION_NUM: | 1965 case content::PERMISSION_NUM: |
| 1964 NOTREACHED() << "Invalid CancelPermission for " << permission; | 1966 NOTREACHED() << "Invalid CancelPermission for " << permission; |
| 1965 break; | 1967 break; |
| 1966 } | 1968 } |
| 1967 } | 1969 } |
| 1968 | 1970 |
| 1969 // Helper method to translate from Permissions to ContentSettings | 1971 // Helper method to translate from Permissions to ContentSettings |
| 1970 static ContentSettingsType PermissionToContentSetting( | 1972 static ContentSettingsType PermissionToContentSetting( |
| 1971 content::PermissionType permission) { | 1973 content::PermissionType permission) { |
| 1972 switch (permission) { | 1974 switch (permission) { |
| 1973 case content::PERMISSION_MIDI_SYSEX: | 1975 case content::PERMISSION_MIDI_SYSEX: |
| 1974 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; | 1976 return CONTENT_SETTINGS_TYPE_MIDI_SYSEX; |
| 1975 case content::PERMISSION_PUSH_MESSAGING: | 1977 case content::PERMISSION_PUSH_MESSAGING: |
| 1976 return CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; | 1978 return CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; |
| 1977 case content::PERMISSION_NOTIFICATIONS: | 1979 case content::PERMISSION_NOTIFICATIONS: |
| 1978 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; | 1980 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; |
| 1979 case content::PERMISSION_GEOLOCATION: | 1981 case content::PERMISSION_GEOLOCATION: |
| 1980 return CONTENT_SETTINGS_TYPE_GEOLOCATION; | 1982 return CONTENT_SETTINGS_TYPE_GEOLOCATION; |
| 1981 #if defined(OS_ANDROID) | 1983 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 1982 case content::PERMISSION_PROTECTED_MEDIA: | 1984 case content::PERMISSION_PROTECTED_MEDIA: |
| 1983 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; | 1985 return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; |
| 1984 #endif | 1986 #endif |
| 1985 default: | 1987 default: |
| 1986 NOTREACHED() << "Unknown content setting for permission " << permission; | 1988 NOTREACHED() << "Unknown content setting for permission " << permission; |
| 1987 return CONTENT_SETTINGS_TYPE_DEFAULT; | 1989 return CONTENT_SETTINGS_TYPE_DEFAULT; |
| 1988 } | 1990 } |
| 1989 } | 1991 } |
| 1990 | 1992 |
| 1991 void ChromeContentBrowserClient::RegisterPermissionUsage( | 1993 void ChromeContentBrowserClient::RegisterPermissionUsage( |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2551 switches::kDisableWebRtcEncryption, | 2553 switches::kDisableWebRtcEncryption, |
| 2552 }; | 2554 }; |
| 2553 to_command_line->CopySwitchesFrom(from_command_line, | 2555 to_command_line->CopySwitchesFrom(from_command_line, |
| 2554 kWebRtcDevSwitchNames, | 2556 kWebRtcDevSwitchNames, |
| 2555 arraysize(kWebRtcDevSwitchNames)); | 2557 arraysize(kWebRtcDevSwitchNames)); |
| 2556 } | 2558 } |
| 2557 } | 2559 } |
| 2558 #endif // defined(ENABLE_WEBRTC) | 2560 #endif // defined(ENABLE_WEBRTC) |
| 2559 | 2561 |
| 2560 } // namespace chrome | 2562 } // namespace chrome |
| OLD | NEW |