Dart Documentationchrome.contentSettingsContentSetting

ContentSetting class

class ContentSetting extends ChromeObject {
 ContentSetting();
 ContentSetting.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * Clear all content setting rules set by this extension.
  */
 Future clear(ContentSettingsClearParams details) {
   var completer = new ChromeCompleter.noArgs();
   jsProxy.callMethod('clear', [jsify(details), completer.callback]);
   return completer.future;
 }

 /**
  * Gets the current content setting for a given pair of URLs.
  */
 Future<Map> get(ContentSettingsGetParams details) {
   var completer = new ChromeCompleter<Map>.oneArg(mapify);
   jsProxy.callMethod('get', [jsify(details), completer.callback]);
   return completer.future;
 }

 /**
  * Applies a new content setting rule.
  */
 Future set(ContentSettingsSetParams details) {
   var completer = new ChromeCompleter.noArgs();
   jsProxy.callMethod('set', [jsify(details), completer.callback]);
   return completer.future;
 }

 /**
  * Returns:
  * A list of resource identifiers for this content type, or [undefined] if
  * this content type does not use resource identifiers.
  */
 Future<List<ResourceIdentifier>> getResourceIdentifiers() {
   var completer = new ChromeCompleter<List<ResourceIdentifier>>.oneArg((e) => listify(e, _createResourceIdentifier));
   jsProxy.callMethod('getResourceIdentifiers', [completer.callback]);
   return completer.future;
 }
}

Extends

ChromeObject > ContentSetting

Constructors

new ContentSetting() #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
ContentSetting();

new ContentSetting.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
ContentSetting.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

Methods

Future clear(ContentSettingsClearParams details) #

Clear all content setting rules set by this extension.

Future clear(ContentSettingsClearParams details) {
 var completer = new ChromeCompleter.noArgs();
 jsProxy.callMethod('clear', [jsify(details), completer.callback]);
 return completer.future;
}

Future<Map> get(ContentSettingsGetParams details) #

Gets the current content setting for a given pair of URLs.

Future<Map> get(ContentSettingsGetParams details) {
 var completer = new ChromeCompleter<Map>.oneArg(mapify);
 jsProxy.callMethod('get', [jsify(details), completer.callback]);
 return completer.future;
}

Future<List<ResourceIdentifier>> getResourceIdentifiers() #

Returns: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.

Future<List<ResourceIdentifier>> getResourceIdentifiers() {
 var completer = new ChromeCompleter<List<ResourceIdentifier>>.oneArg((e) => listify(e, _createResourceIdentifier));
 jsProxy.callMethod('getResourceIdentifiers', [completer.callback]);
 return completer.future;
}

Future set(ContentSettingsSetParams details) #

Applies a new content setting rule.

Future set(ContentSettingsSetParams details) {
 var completer = new ChromeCompleter.noArgs();
 jsProxy.callMethod('set', [jsify(details), completer.callback]);
 return completer.future;
}

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();