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 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 if (setting == CONTENT_SETTING_BLOCK) | 1893 if (setting == CONTENT_SETTING_BLOCK) |
1894 return blink::WebNotificationPermissionDenied; | 1894 return blink::WebNotificationPermissionDenied; |
1895 return blink::WebNotificationPermissionDefault; | 1895 return blink::WebNotificationPermissionDefault; |
1896 #else | 1896 #else |
1897 return blink::WebNotificationPermissionAllowed; | 1897 return blink::WebNotificationPermissionAllowed; |
1898 #endif | 1898 #endif |
1899 } | 1899 } |
1900 | 1900 |
1901 void ChromeContentBrowserClient::ShowDesktopNotification( | 1901 void ChromeContentBrowserClient::ShowDesktopNotification( |
1902 const content::ShowDesktopNotificationHostMsgParams& params, | 1902 const content::ShowDesktopNotificationHostMsgParams& params, |
1903 RenderFrameHost* render_frame_host, | 1903 content::BrowserContext* browser_context, |
| 1904 int render_process_id, |
1904 scoped_ptr<content::DesktopNotificationDelegate> delegate, | 1905 scoped_ptr<content::DesktopNotificationDelegate> delegate, |
1905 base::Closure* cancel_callback) { | 1906 base::Closure* cancel_callback) { |
1906 #if defined(ENABLE_NOTIFICATIONS) | 1907 #if defined(ENABLE_NOTIFICATIONS) |
1907 content::RenderProcessHost* process = render_frame_host->GetProcess(); | 1908 Profile* profile = Profile::FromBrowserContext(browser_context); |
1908 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext()); | 1909 DCHECK(profile); |
| 1910 |
1909 DesktopNotificationService* service = | 1911 DesktopNotificationService* service = |
1910 DesktopNotificationServiceFactory::GetForProfile(profile); | 1912 DesktopNotificationServiceFactory::GetForProfile(profile); |
| 1913 DCHECK(service); |
| 1914 |
1911 service->ShowDesktopNotification( | 1915 service->ShowDesktopNotification( |
1912 params, render_frame_host, delegate.Pass(), cancel_callback); | 1916 params, render_process_id, delegate.Pass(), cancel_callback); |
1913 | |
1914 profile->GetHostContentSettingsMap()->UpdateLastUsage( | 1917 profile->GetHostContentSettingsMap()->UpdateLastUsage( |
1915 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 1918 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
1916 #else | 1919 #else |
1917 NOTIMPLEMENTED(); | 1920 NOTIMPLEMENTED(); |
1918 #endif | 1921 #endif |
1919 } | 1922 } |
1920 | 1923 |
1921 void ChromeContentBrowserClient::RequestGeolocationPermission( | 1924 void ChromeContentBrowserClient::RequestGeolocationPermission( |
1922 content::WebContents* web_contents, | 1925 content::WebContents* web_contents, |
1923 int bridge_id, | 1926 int bridge_id, |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2611 switches::kDisableWebRtcEncryption, | 2614 switches::kDisableWebRtcEncryption, |
2612 }; | 2615 }; |
2613 to_command_line->CopySwitchesFrom(from_command_line, | 2616 to_command_line->CopySwitchesFrom(from_command_line, |
2614 kWebRtcDevSwitchNames, | 2617 kWebRtcDevSwitchNames, |
2615 arraysize(kWebRtcDevSwitchNames)); | 2618 arraysize(kWebRtcDevSwitchNames)); |
2616 } | 2619 } |
2617 } | 2620 } |
2618 #endif // defined(ENABLE_WEBRTC) | 2621 #endif // defined(ENABLE_WEBRTC) |
2619 | 2622 |
2620 } // namespace chrome | 2623 } // namespace chrome |
OLD | NEW |