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

Side by Side Diff: chrome/browser/chrome_webusb_browser_client.cc

Issue 1289423002: Add webusb notification UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved webusb::WebUsbDetector::GetInstance() call to chrome_browser_main.cc 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698