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

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

Issue 376253005: Migrate the notification permission to the new common permission classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 } 2123 }
2124 } 2124 }
2125 } 2125 }
2126 if (IsExtensionWithPermissionOrSuggestInConsole( 2126 if (IsExtensionWithPermissionOrSuggestInConsole(
2127 APIPermission::kNotification, extension, 2127 APIPermission::kNotification, extension,
2128 render_frame_host->GetRenderViewHost())) { 2128 render_frame_host->GetRenderViewHost())) {
2129 callback.Run(); 2129 callback.Run();
2130 return; 2130 return;
2131 } 2131 }
2132 2132
2133 WebContents* web_contents = WebContents::FromRenderFrameHost(
2134 render_frame_host);
Peter Beverloo 2014/07/18 10:42:38 nit: four space indent
Miguel Garcia 2014/07/18 12:27:08 Done.
2135 int render_process_id = render_frame_host->GetProcess()->GetID();
2136 const PermissionRequestID id(render_process_id,
Peter Beverloo 2014/07/18 10:42:37 nit: s/id/request_id/ for consistency.
Miguel Garcia 2014/07/18 12:27:08 Done.
2137 web_contents->GetRoutingID(), -1 /* bridge id */,
Peter Beverloo 2014/07/18 10:42:37 nit: one argument a line.
Miguel Garcia 2014/07/18 12:27:08 Done.
2138 GURL());
2139
2133 notification_service->RequestPermission( 2140 notification_service->RequestPermission(
2134 source_origin, render_frame_host, callback); 2141 web_contents,
2142 id,
2143 source_origin,
2144 // TODO(peter): plumb user_gesture over IPC
2145 true,
2146 base::Bind(&ChromeContentBrowserClient::NotificationPermissionRequested,
2147 weak_factory_.GetWeakPtr(), callback));
Peter Beverloo 2014/07/18 10:42:37 nit: |callback| should be on its own line.
Miguel Garcia 2014/07/18 12:27:08 Done.
2148
2135 #else 2149 #else
2136 NOTIMPLEMENTED(); 2150 NOTIMPLEMENTED();
2137 #endif 2151 #endif
2138 } 2152 }
2139 2153
2140 blink::WebNotificationPresenter::Permission 2154 blink::WebNotificationPresenter::Permission
2141 ChromeContentBrowserClient::CheckDesktopNotificationPermission( 2155 ChromeContentBrowserClient::CheckDesktopNotificationPermission(
2142 const GURL& source_origin, 2156 const GURL& source_origin,
2143 content::ResourceContext* context, 2157 content::ResourceContext* context,
2144 int render_process_id) { 2158 int render_process_id) {
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2914 static const char* const kWebRtcDevSwitchNames[] = { 2928 static const char* const kWebRtcDevSwitchNames[] = {
2915 switches::kDisableWebRtcEncryption, 2929 switches::kDisableWebRtcEncryption,
2916 }; 2930 };
2917 to_command_line->CopySwitchesFrom(from_command_line, 2931 to_command_line->CopySwitchesFrom(from_command_line,
2918 kWebRtcDevSwitchNames, 2932 kWebRtcDevSwitchNames,
2919 arraysize(kWebRtcDevSwitchNames)); 2933 arraysize(kWebRtcDevSwitchNames));
2920 } 2934 }
2921 } 2935 }
2922 #endif // defined(ENABLE_WEBRTC) 2936 #endif // defined(ENABLE_WEBRTC)
2923 2937
2938
2939 void ChromeContentBrowserClient::NotificationPermissionRequested(
2940 base::Closure callback, bool result) {
2941 callback.Run();
2942 }
2943
2924 } // namespace chrome 2944 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698