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

Unified 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: updated gn file 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_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..85301b4de96a8b206a48b5364470041176166821
--- /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.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(Profile* profile, const GURL& url) {
+ Browser* browser =
+ chrome::FindBrowserWithProfile(profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
Reilly Grant (use Gerrit) 2015/08/18 18:30:02 I think we can use ProfileManager::GetActiveProfil
juncai 2015/08/20 15:56:32 Done.
+ 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);
+}
« no previous file with comments | « chrome/browser/chrome_webusb_browser_client.h ('k') | chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698