| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/usb/web_usb_detector.h" | 5 #include "chrome/browser/usb/web_usb_detector.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/base/page_transition_types.h" | 23 #include "ui/base/page_transition_types.h" |
| 24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 25 #include "ui/base/window_open_disposition.h" | 25 #include "ui/base/window_open_disposition.h" |
| 26 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
| 27 #include "ui/message_center/message_center.h" | 27 #include "ui/message_center/message_center.h" |
| 28 #include "ui/message_center/notification.h" | 28 #include "ui/message_center/notification.h" |
| 29 #include "ui/message_center/notification_delegate.h" | 29 #include "ui/message_center/notification_delegate.h" |
| 30 #include "url/gurl.h" | 30 #include "url/gurl.h" |
| 31 | 31 |
| 32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
| 33 #include "ash/common/system/system_notifier.h" // nogncheck | 33 #include "ash/system/system_notifier.h" // nogncheck |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // The WebUSB notification should be displayed for all profiles. On ChromeOS | 38 // The WebUSB notification should be displayed for all profiles. On ChromeOS |
| 39 // that requires its notifier ID to be known by Ash so that it is not blocked in | 39 // that requires its notifier ID to be known by Ash so that it is not blocked in |
| 40 // multi-profile mode. | 40 // multi-profile mode. |
| 41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 42 #define kNotifierWebUsb ash::system_notifier::kNotifierWebUsb | 42 #define kNotifierWebUsb ash::system_notifier::kNotifierWebUsb |
| 43 #else | 43 #else |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 void WebUsbDetector::OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) { | 169 void WebUsbDetector::OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) { |
| 170 std::string notification_id = device->guid(); | 170 std::string notification_id = device->guid(); |
| 171 message_center::MessageCenter* message_center = | 171 message_center::MessageCenter* message_center = |
| 172 message_center::MessageCenter::Get(); | 172 message_center::MessageCenter::Get(); |
| 173 if (message_center->FindVisibleNotificationById(notification_id)) { | 173 if (message_center->FindVisibleNotificationById(notification_id)) { |
| 174 message_center->RemoveNotification(notification_id, false /* by_user */); | 174 message_center->RemoveNotification(notification_id, false /* by_user */); |
| 175 } | 175 } |
| 176 } | 176 } |
| OLD | NEW |