summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2016-01-06 11:21:48 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-06 19:22:33 +0000
commitfd341ed2afae7ac7f456738f14527f965251a7aa (patch)
treea1aa799b4f179adb633c5155a6e36e16b4c22119
parent927618090a4655a952bf4174ace62f94e973c7fb (diff)
downloadchromium_src-fd341ed2afae7ac7f456738f14527f965251a7aa.zip
chromium_src-fd341ed2afae7ac7f456738f14527f965251a7aa.tar.gz
chromium_src-fd341ed2afae7ac7f456738f14527f965251a7aa.tar.bz2
Fix handling of ephemeral USB permissions in content settings.
This change first marks ephemeral USB permissions as coming from the "preference" source, which means user preferences and is close enough to the truth. The content settings handler is also change to update the model whenever revoking a permission instead of monitoring for content settings changes. This is because ephemeral permission changes don't touch real content settings. BUG=529950 Review URL: https://codereview.chromium.org/1517373002 Cr-Commit-Position: refs/heads/master@{#367875}
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc7
-rw-r--r--chrome/browser/usb/usb_chooser_context.cc6
2 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 935897c..325974c 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -777,12 +777,6 @@ void ContentSettingsHandler::OnContentSettingChanged(
} else {
if (ContainsKey(GetExceptionsInfoMap(), details.type()))
UpdateExceptionsViewFromModel(details.type());
- for (const ChooserTypeNameEntry& chooser_type : kChooserTypeGroupNames) {
- if (chooser_type.type == details.type()) {
- UpdateChooserExceptionsViewFromModel(chooser_type);
- break;
- }
- }
}
}
@@ -1512,6 +1506,7 @@ void ContentSettingsHandler::RemoveChooserException(
ChooserContextBase* chooser_context = chooser_type->get_context(profile);
chooser_context->RevokeObjectPermission(requesting_origin, embedding_origin,
*object);
+ UpdateChooserExceptionsViewFromModel(*chooser_type);
// TODO(reillyg): Create metrics for revocations. crbug.com/556845
}
diff --git a/chrome/browser/usb/usb_chooser_context.cc b/chrome/browser/usb/usb_chooser_context.cc
index fc940c9..702c98a 100644
--- a/chrome/browser/usb/usb_chooser_context.cc
+++ b/chrome/browser/usb/usb_chooser_context.cc
@@ -100,9 +100,9 @@ UsbChooserContext::GetAllGrantedObjects() {
base::DictionaryValue object;
object.SetString(kDeviceNameKey, device->product_string());
object.SetString(kGuidKey, device->guid());
- objects.push_back(make_scoped_ptr(
- new ChooserContextBase::Object(requesting_origin, embedding_origin,
- &object, "", is_off_the_record_)));
+ objects.push_back(make_scoped_ptr(new ChooserContextBase::Object(
+ requesting_origin, embedding_origin, &object, "preference",
+ is_off_the_record_)));
}
}