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

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

Issue 433273002: NotificationObjectProxy should own the DesktopNotificationDelegateImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass as scoped_ptr Created 6 years, 4 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 | Annotate | Revision Log
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "components/pref_registry/pref_registry_syncable.h" 97 #include "components/pref_registry/pref_registry_syncable.h"
98 #include "components/signin/core/common/profile_management_switches.h" 98 #include "components/signin/core/common/profile_management_switches.h"
99 #include "components/translate/core/common/translate_switches.h" 99 #include "components/translate/core/common/translate_switches.h"
100 #include "content/public/browser/browser_child_process_host.h" 100 #include "content/public/browser/browser_child_process_host.h"
101 #include "content/public/browser/browser_main_parts.h" 101 #include "content/public/browser/browser_main_parts.h"
102 #include "content/public/browser/browser_ppapi_host.h" 102 #include "content/public/browser/browser_ppapi_host.h"
103 #include "content/public/browser/browser_thread.h" 103 #include "content/public/browser/browser_thread.h"
104 #include "content/public/browser/browser_url_handler.h" 104 #include "content/public/browser/browser_url_handler.h"
105 #include "content/public/browser/child_process_data.h" 105 #include "content/public/browser/child_process_data.h"
106 #include "content/public/browser/child_process_security_policy.h" 106 #include "content/public/browser/child_process_security_policy.h"
107 #include "content/public/browser/desktop_notification_delegate.h"
107 #include "content/public/browser/render_frame_host.h" 108 #include "content/public/browser/render_frame_host.h"
108 #include "content/public/browser/render_process_host.h" 109 #include "content/public/browser/render_process_host.h"
109 #include "content/public/browser/render_view_host.h" 110 #include "content/public/browser/render_view_host.h"
110 #include "content/public/browser/resource_context.h" 111 #include "content/public/browser/resource_context.h"
111 #include "content/public/browser/site_instance.h" 112 #include "content/public/browser/site_instance.h"
112 #include "content/public/browser/web_contents.h" 113 #include "content/public/browser/web_contents.h"
113 #include "content/public/common/child_process_host.h" 114 #include "content/public/common/child_process_host.h"
114 #include "content/public/common/content_descriptors.h" 115 #include "content/public/common/content_descriptors.h"
115 #include "content/public/common/show_desktop_notification_params.h" 116 #include "content/public/common/show_desktop_notification_params.h"
116 #include "content/public/common/url_utils.h" 117 #include "content/public/common/url_utils.h"
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 return blink::WebNotificationPermissionDenied; 1877 return blink::WebNotificationPermissionDenied;
1877 return blink::WebNotificationPermissionDefault; 1878 return blink::WebNotificationPermissionDefault;
1878 #else 1879 #else
1879 return blink::WebNotificationPermissionAllowed; 1880 return blink::WebNotificationPermissionAllowed;
1880 #endif 1881 #endif
1881 } 1882 }
1882 1883
1883 void ChromeContentBrowserClient::ShowDesktopNotification( 1884 void ChromeContentBrowserClient::ShowDesktopNotification(
1884 const content::ShowDesktopNotificationHostMsgParams& params, 1885 const content::ShowDesktopNotificationHostMsgParams& params,
1885 RenderFrameHost* render_frame_host, 1886 RenderFrameHost* render_frame_host,
1886 content::DesktopNotificationDelegate* delegate, 1887 scoped_ptr<content::DesktopNotificationDelegate> delegate,
1887 base::Closure* cancel_callback) { 1888 base::Closure* cancel_callback) {
1888 #if defined(ENABLE_NOTIFICATIONS) 1889 #if defined(ENABLE_NOTIFICATIONS)
1889 content::RenderProcessHost* process = render_frame_host->GetProcess(); 1890 content::RenderProcessHost* process = render_frame_host->GetProcess();
1890 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext()); 1891 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
1891 DesktopNotificationService* service = 1892 DesktopNotificationService* service =
1892 DesktopNotificationServiceFactory::GetForProfile(profile); 1893 DesktopNotificationServiceFactory::GetForProfile(profile);
1893 service->ShowDesktopNotification( 1894 service->ShowDesktopNotification(
1894 params, render_frame_host, delegate, cancel_callback); 1895 params, render_frame_host, delegate.Pass(), cancel_callback);
1895 1896
1896 profile->GetHostContentSettingsMap()->UpdateLastUsage( 1897 profile->GetHostContentSettingsMap()->UpdateLastUsage(
1897 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); 1898 params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
1898 #else 1899 #else
1899 NOTIMPLEMENTED(); 1900 NOTIMPLEMENTED();
1900 #endif 1901 #endif
1901 } 1902 }
1902 1903
1903 void ChromeContentBrowserClient::RequestGeolocationPermission( 1904 void ChromeContentBrowserClient::RequestGeolocationPermission(
1904 content::WebContents* web_contents, 1905 content::WebContents* web_contents,
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 switches::kDisableWebRtcEncryption, 2599 switches::kDisableWebRtcEncryption,
2599 }; 2600 };
2600 to_command_line->CopySwitchesFrom(from_command_line, 2601 to_command_line->CopySwitchesFrom(from_command_line,
2601 kWebRtcDevSwitchNames, 2602 kWebRtcDevSwitchNames,
2602 arraysize(kWebRtcDevSwitchNames)); 2603 arraysize(kWebRtcDevSwitchNames));
2603 } 2604 }
2604 } 2605 }
2605 #endif // defined(ENABLE_WEBRTC) 2606 #endif // defined(ENABLE_WEBRTC)
2606 2607
2607 } // namespace chrome 2608 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/notifications/desktop_notification_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698