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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1289423002: Add webusb notification UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated code so that Chrome browser process owns WebUsbBrowserClient and WebUsbDetector objects Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index eb0cf4f30c8fb1a4bb321659c332e3e300f3173a..ad975824a363a61f19da48eaf392fcc0bbc0a116 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -235,6 +235,11 @@
#include "ui/aura/env.h"
#endif // defined(USE_AURA)
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#include "chrome/browser/chrome_webusb_browser_client.h"
+#include "components/webusb/webusb_detector.h"
+#endif
+
using content::BrowserThread;
namespace {
@@ -1164,6 +1169,15 @@ void ChromeBrowserMainParts::PostBrowserStart() {
base::TimeDelta::FromMinutes(1));
#endif // defined(ENABLE_WEBRTC)
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebUsbNotifications)) {
+ webusb_browser_client_.reset(new ChromeWebUsbBrowserClient());
+ webusb::WebUsbBrowserClient::Set(webusb_browser_client_.get());
+ webusb_detector_.reset(new webusb::WebUsbDetector());
stevenjb 2015/08/28 16:55:05 Couldn't this just be: webusb_detector_.reset(new
juncai 2015/08/28 20:23:56 Done.
+ }
+#endif
+
// At this point, StartupBrowserCreator::Start has run creating initial
// browser windows and tabs, but no progress has been made in loading
// content as the main message loop hasn't started processing tasks yet.

Powered by Google App Engine
This is Rietveld 408576698