Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 578883003: Remove the strict dependency on WebContents for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 if (setting == CONTENT_SETTING_BLOCK) 1897 if (setting == CONTENT_SETTING_BLOCK)
1898 return blink::WebNotificationPermissionDenied; 1898 return blink::WebNotificationPermissionDenied;
1899 return blink::WebNotificationPermissionDefault; 1899 return blink::WebNotificationPermissionDefault;
1900 #else 1900 #else
1901 return blink::WebNotificationPermissionAllowed; 1901 return blink::WebNotificationPermissionAllowed;
1902 #endif 1902 #endif
1903 } 1903 }
1904 1904
1905 void ChromeContentBrowserClient::ShowDesktopNotification( 1905 void ChromeContentBrowserClient::ShowDesktopNotification(
1906 const content::ShowDesktopNotificationHostMsgParams& params, 1906 const content::ShowDesktopNotificationHostMsgParams& params,
1907 RenderFrameHost* render_frame_host, 1907 content::BrowserContext* browser_context,
1908 scoped_ptr<content::DesktopNotificationDelegate> delegate, 1908 scoped_ptr<content::DesktopNotificationDelegate> delegate,
1909 base::Closure* cancel_callback) { 1909 base::Closure* cancel_callback) {
1910 #if defined(ENABLE_NOTIFICATIONS) 1910 #if defined(ENABLE_NOTIFICATIONS)
1911 content::RenderProcessHost* process = render_frame_host->GetProcess(); 1911 Profile* profile = Profile::FromBrowserContext(browser_context);
1912 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
1913 DesktopNotificationService* service = 1912 DesktopNotificationService* service =
dewittj 2014/09/17 16:58:48 So DNS needs a Profile* (as opposed to a BrowserCo
Peter Beverloo 2014/09/17 17:06:06 We use the preferences (Profile::GetPrefs()) and h
1914 DesktopNotificationServiceFactory::GetForProfile(profile); 1913 DesktopNotificationServiceFactory::GetForProfile(profile);
1915 service->ShowDesktopNotification( 1914 service->ShowDesktopNotification(
1916 params, render_frame_host, delegate.Pass(), cancel_callback); 1915 params, delegate.Pass(), cancel_callback);
Jun Mukai 2014/09/18 18:00:59 doesn't this fit into the previous line?
Peter Beverloo 2014/10/03 14:39:30 Done.
1917 1916
1918 profile->GetHostContentSettingsMap()->UpdateLastUsage( 1917 profile->GetHostContentSettingsMap()->UpdateLastUsage(
1919 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); 1918 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
1920 #else 1919 #else
1921 NOTIMPLEMENTED(); 1920 NOTIMPLEMENTED();
1922 #endif 1921 #endif
1923 } 1922 }
1924 1923
1925 void ChromeContentBrowserClient::RequestGeolocationPermission( 1924 void ChromeContentBrowserClient::RequestGeolocationPermission(
1926 content::WebContents* web_contents, 1925 content::WebContents* web_contents,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2591 switches::kDisableWebRtcEncryption, 2590 switches::kDisableWebRtcEncryption,
2592 }; 2591 };
2593 to_command_line->CopySwitchesFrom(from_command_line, 2592 to_command_line->CopySwitchesFrom(from_command_line,
2594 kWebRtcDevSwitchNames, 2593 kWebRtcDevSwitchNames,
2595 arraysize(kWebRtcDevSwitchNames)); 2594 arraysize(kWebRtcDevSwitchNames));
2596 } 2595 }
2597 } 2596 }
2598 #endif // defined(ENABLE_WEBRTC) 2597 #endif // defined(ENABLE_WEBRTC)
2599 2598
2600 } // namespace chrome 2599 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698