OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chrome_webusb_browser_client.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/net/referrer.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_finder.h" |
| 12 #include "chrome/browser/ui/host_desktop.h" |
| 13 #include "chrome/common/chrome_switches.h" |
| 14 #include "ui/base/page_transition_types.h" |
| 15 #include "ui/base/window_open_disposition.h" |
| 16 #include "url/gurl.h" |
| 17 |
| 18 ChromeWebUsbBrowserClient::ChromeWebUsbBrowserClient() {} |
| 19 |
| 20 ChromeWebUsbBrowserClient::~ChromeWebUsbBrowserClient() {} |
| 21 |
| 22 void ChromeWebUsbBrowserClient::OpenURL(const GURL& url) { |
| 23 Browser* browser = chrome::FindBrowserWithProfile( |
| 24 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 25 content::OpenURLParams params(url, content::Referrer(), NEW_FOREGROUND_TAB, |
| 26 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, true); |
| 27 browser->OpenURL(params); |
| 28 } |
| 29 |
| 30 bool ChromeWebUsbBrowserClient::WebUsbNotificationEnabled() { |
| 31 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 switches::kEnableWebUsbNotification); |
| 33 } |
OLD | NEW |