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

Unified Diff: chrome/browser/ui/media_utils.cc

Issue 2642763003: Remove chrome/browser/ui/media_utils.{cc|h} (Closed)
Patch Set: rebase and address review comments Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/media_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/media_utils.cc
diff --git a/chrome/browser/ui/media_utils.cc b/chrome/browser/ui/media_utils.cc
deleted file mode 100644
index bae2e2e115274f532b04ae6b1d7959b847778e86..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/media_utils.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/media_utils.h"
-
-#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/web_contents.h"
-#include "extensions/features/features.h"
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/browser/extension_registry.h"
-#include "extensions/common/constants.h"
-#endif
-
-namespace {
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-const extensions::Extension* GetExtensionForOrigin(Profile* profile,
- const GURL& security_origin) {
- if (!security_origin.SchemeIs(extensions::kExtensionScheme))
- return NULL;
-
- const extensions::Extension* extension =
- extensions::ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(
- security_origin.host());
- DCHECK(extension);
- return extension;
-}
-#endif
-
-} // namespace
-
-void RequestMediaAccessPermission(
- content::WebContents* web_contents,
- Profile* profile,
- const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback) {
- const extensions::Extension* extension = NULL;
-#if BUILDFLAG(ENABLE_EXTENSIONS)
- extension = GetExtensionForOrigin(profile, request.security_origin);
-#endif
- MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
- web_contents, request, callback, extension);
-}
-
-bool CheckMediaAccessPermission(content::WebContents* web_contents,
- const GURL& security_origin,
- content::MediaStreamType type) {
-#if BUILDFLAG(ENABLE_EXTENSIONS)
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
- const extensions::Extension* extension =
- GetExtensionForOrigin(profile, security_origin);
- if (extension) {
- return MediaCaptureDevicesDispatcher::GetInstance()
- ->CheckMediaAccessPermission(
- web_contents, security_origin, type, extension);
- }
- return MediaCaptureDevicesDispatcher::GetInstance()
- ->CheckMediaAccessPermission(web_contents, security_origin, type);
-#else
- return MediaCaptureDevicesDispatcher::GetInstance()
- ->CheckMediaAccessPermission(web_contents, security_origin, type);
-#endif
-}
« no previous file with comments | « chrome/browser/ui/media_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698