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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1371793004: Provide the DeviceManager service to the renderer directly, no app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface_permission
Patch Set: Fix chrome_browser.gypi. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index dd26039d02ff83f3b1baad445e45531bb99f2ea0..11725b5715691801a807d81b860d4ed65aca6975 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -82,6 +82,7 @@
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/browser/ui/webui/log_web_ui_url.h"
+#include "chrome/browser/usb/web_usb_permission_provider.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
@@ -133,8 +134,7 @@
#include "content/public/common/service_registry.h"
#include "content/public/common/url_utils.h"
#include "content/public/common/web_preferences.h"
-#include "device/devices_app/public/cpp/constants.h"
-#include "device/devices_app/public/cpp/devices_app_factory.h"
+#include "device/devices_app/usb/device_manager_impl.h"
#include "gin/v8_initializer.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "net/base/mime_util.h"
@@ -261,10 +261,6 @@
#include "chrome/browser/media/router/presentation_service_delegate_impl.h"
#endif
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-#include "chrome/browser/usb/web_usb_permission_provider.h"
-#endif
-
using base::FileDescriptor;
using blink::WebWindowFeatures;
using content::AccessTokenStore;
@@ -623,6 +619,18 @@ void GetGuestViewDefaultContentSettingRules(
}
#endif // defined(ENABLE_EXTENSIONS)
+void CreateUsbDeviceManager(
+ RenderFrameHost* render_frame_host,
+ mojo::InterfaceRequest<device::usb::DeviceManager> request) {
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ device::usb::PermissionProviderPtr permission_provider;
+ WebUSBPermissionProvider::Create(render_frame_host,
+ mojo::GetProxy(&permission_provider));
+ device::usb::DeviceManagerImpl::Create(permission_provider.Pass(),
+ request.Pass());
+#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
+}
+
} // namespace
ChromeContentBrowserClient::ChromeContentBrowserClient()
@@ -2544,19 +2552,12 @@ void ChromeContentBrowserClient::RegisterFrameMojoShellServices(
base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create,
render_frame_host));
#endif
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
- registry->AddService(
- base::Bind(&WebUSBPermissionProvider::Create, render_frame_host));
-#endif
}
-void ChromeContentBrowserClient::RegisterInProcessMojoApplications(
- StaticMojoApplicationMap* apps) {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
- apps->insert(std::make_pair(GURL(device::kDevicesMojoAppUrl),
- base::Bind(&device::DevicesAppFactory::CreateApp,
- base::ThreadTaskRunnerHandle::Get())));
-#endif
+void ChromeContentBrowserClient::RegisterRenderFrameMojoServices(
+ content::ServiceRegistry* registry,
+ content::RenderFrameHost* render_frame_host) {
+ registry->AddService(base::Bind(&CreateUsbDeviceManager, render_frame_host));
}
void ChromeContentBrowserClient::OpenURL(
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698