Index: chrome/browser/chrome_webusb_browser_client.cc |
diff --git a/chrome/browser/chrome_webusb_browser_client.cc b/chrome/browser/chrome_webusb_browser_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..76411cdee831bf20bbac88eeab1b914c6ed53319 |
--- /dev/null |
+++ b/chrome/browser/chrome_webusb_browser_client.cc |
@@ -0,0 +1,33 @@ |
+// Copyright 2015 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/chrome_webusb_browser_client.h" |
+ |
+#include "base/command_line.h" |
+#include "chrome/browser/net/referrer.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/browser_finder.h" |
+#include "chrome/browser/ui/host_desktop.h" |
+#include "chrome/common/chrome_switches.h" |
+#include "ui/base/page_transition_types.h" |
+#include "ui/base/window_open_disposition.h" |
+#include "url/gurl.h" |
+ |
+ChromeWebUsbBrowserClient::ChromeWebUsbBrowserClient() {} |
+ |
+ChromeWebUsbBrowserClient::~ChromeWebUsbBrowserClient() {} |
+ |
+void ChromeWebUsbBrowserClient::OpenURL(const GURL& url) { |
+ Browser* browser = chrome::FindBrowserWithProfile( |
+ ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_NATIVE); |
+ content::OpenURLParams params(url, content::Referrer(), NEW_FOREGROUND_TAB, |
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL, true); |
+ browser->OpenURL(params); |
+} |
+ |
+bool ChromeWebUsbBrowserClient::WebUsbNotificationEnabled() { |
+ return base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableWebUsbNotification); |
+} |