Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
| 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/hid/hid_connection_tracker.h" |
| 6 | |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 7 | #include "chrome/browser/browser_process.h" |
Jack Hsieh | ea76b94b5 | 2022-12-13 16:37:05 | [diff] [blame] | 8 | #include "chrome/browser/hid/hid_system_tray_icon.h" |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 9 | #include "chrome/browser/ui/chrome_pages.h" |
Jack Hsieh | c444122 | 2023-04-21 20:44:53 | [diff] [blame] | 10 | |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 11 | HidConnectionTracker::HidConnectionTracker(Profile* profile) |
Juan Garza Sanchez | 687e50f | 2023-09-14 00:26:07 | [diff] [blame] | 12 | : DeviceConnectionTracker(profile) { |
| 13 | whitelisted_origins_.push_back(url::Origin::Create( |
| 14 | GURL("chrome-extension://ckcendljdlmgnhghiaomidhiiclmapok"))); |
| 15 | whitelisted_origins_.push_back(url::Origin::Create( |
| 16 | GURL("chrome-extension://lfboplenmmjcmpbkeemecobbadnmpfhi"))); |
| 17 | } |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 18 | |
Jack Hsieh | e057e155 | 2023-05-19 17:14:06 | [diff] [blame] | 19 | HidConnectionTracker::~HidConnectionTracker() = default; |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 20 | |
Jack Hsieh | e137115 | 2023-04-15 10:04:22 | [diff] [blame] | 21 | void HidConnectionTracker::ShowContentSettingsExceptions() { |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 22 | chrome::ShowContentSettingsExceptionsForProfile( |
| 23 | profile_, ContentSettingsType::HID_CHOOSER_DATA); |
| 24 | } |
| 25 | |
Jack Hsieh | e057e155 | 2023-05-19 17:14:06 | [diff] [blame] | 26 | DeviceSystemTrayIcon* HidConnectionTracker::GetSystemTrayIcon() { |
| 27 | return static_cast<DeviceSystemTrayIcon*>( |
| 28 | g_browser_process->hid_system_tray_icon()); |
Jack Hsieh | aba56028 | 2022-12-12 17:36:53 | [diff] [blame] | 29 | } |
Sylvain Defresne | ad5329c | 2024-07-08 09:38:30 | [diff] [blame] | 30 | |
| 31 | void HidConnectionTracker::Shutdown() { |
| 32 | CleanUp(); |
| 33 | DeviceConnectionTracker::Shutdown(); |
| 34 | } |