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

Unified Diff: content/shell/browser/layout_test/layout_test_content_browser_client.cc

Issue 1011953003: Refactor Permissions related method out of ContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_type_enum_class
Patch Set: fix cros Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/layout_test/layout_test_content_browser_client.cc
diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.cc b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
index 938994538fe4ad73fe2f7bea1dd60ee2268fb691..b98ce58d93f7c9fb00df3ef9647a44d80434306d 100644
--- a/content/shell/browser/layout_test/layout_test_content_browser_client.cc
+++ b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
@@ -7,7 +7,6 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigator_connect_context.h"
-#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/shell/browser/layout_test/layout_test_browser_context.h"
@@ -23,21 +22,6 @@ namespace {
LayoutTestContentBrowserClient* g_layout_test_browser_client;
-void RequestDesktopNotificationPermissionOnIO(
- const GURL& source_origin,
- const base::Callback<void(PermissionStatus)>& callback) {
- LayoutTestNotificationManager* manager =
- LayoutTestContentBrowserClient::Get()->GetLayoutTestNotificationManager();
- PermissionStatus result = manager ? manager->RequestPermission(source_origin)
- : PERMISSION_STATUS_GRANTED;
-
- // The callback came from the UI thread, we need to run it from there again.
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(callback, result));
-}
-
} // namespace
LayoutTestContentBrowserClient::LayoutTestContentBrowserClient() {
@@ -81,31 +65,6 @@ void LayoutTestContentBrowserClient::RenderProcessWillLaunch(
host->Send(new ShellViewMsg_SetWebKitSourceDir(GetWebKitRootDirFilePath()));
}
-void LayoutTestContentBrowserClient::RequestPermission(
- PermissionType permission,
- WebContents* web_contents,
- int bridge_id,
- const GURL& requesting_frame,
- bool user_gesture,
- const base::Callback<void(PermissionStatus)>& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (permission == PermissionType::NOTIFICATIONS) {
- BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(&RequestDesktopNotificationPermissionOnIO,
- requesting_frame,
- callback));
- return;
- }
- ShellContentBrowserClient::RequestPermission(permission,
- web_contents,
- bridge_id,
- requesting_frame,
- user_gesture,
- callback);
-}
-
PlatformNotificationService*
LayoutTestContentBrowserClient::GetPlatformNotificationService() {
return layout_test_notification_manager_.get();

Powered by Google App Engine
This is Rietveld 408576698