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

Unified Diff: extensions/browser/api/usb/usb_apitest.cc

Issue 2390823005: Update device permissions dialog ui for Chrome apps and extensions (Closed)
Patch Set: address more comments Created 4 years, 1 month 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
« no previous file with comments | « extensions/browser/api/hid/hid_apitest.cc ('k') | extensions/strings/extensions_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_apitest.cc
diff --git a/extensions/browser/api/usb/usb_apitest.cc b/extensions/browser/api/usb/usb_apitest.cc
index cfad67d1deedc413d6dd4e829fe08b4d46bbdfae..9057178f646da6c8bd096b54abd76301f8b53db8 100644
--- a/extensions/browser/api/usb/usb_apitest.cc
+++ b/extensions/browser/api/usb/usb_apitest.cc
@@ -107,7 +107,17 @@ class TestDevicePermissionsPrompt
void ShowDialog() override { prompt()->SetObserver(this); }
- void OnDevicesChanged() override {
+ void OnDeviceAdded(size_t index, const base::string16& device_name) override {
+ OnDevicesChanged();
+ }
+
+ void OnDeviceRemoved(size_t index,
+ const base::string16& device_name) override {
+ OnDevicesChanged();
+ }
+
+ private:
+ void OnDevicesChanged() {
for (size_t i = 0; i < prompt()->GetDeviceCount(); ++i) {
prompt()->GrantDevicePermission(i);
if (!prompt()->multiple()) {
« no previous file with comments | « extensions/browser/api/hid/hid_apitest.cc ('k') | extensions/strings/extensions_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698