当前位置: 首页 > news >正文

书画院网站建设方案域名停靠网页app推广大全

书画院网站建设方案,域名停靠网页app推广大全,外贸行销网站,安徽全过程网站搭建案例一、chrome.system.storage 您可以使用 chrome.system.storage API 查询存储设备信息,并在连接和分离可移动存储设备时收到通知。 权限 system.storage 类型 EjectDeviceResultCode 枚举 "success" 移除命令成功执行 - 应用可以提示用户移除设备。…

一、chrome.system.storage

您可以使用 chrome.system.storage API 查询存储设备信息,并在连接和分离可移动存储设备时收到通知。

权限

system.storage

类型

EjectDeviceResultCode

枚举

"success"
移除命令成功执行 - 应用可以提示用户移除设备。

"in_use"
设备正被其他应用使用。移除失败;在其他应用完成对设备的操作之前,用户不得移除设备。

"no_such_device"
没有已知的此类设备。

"failure"
移除命令失败。

StorageAvailableCapacityInfo

属性
  • availableCapacity

    number

    存储设备的可用容量(以字节为单位)。

  • id

    字符串

    getAvailableCapacity 函数参数 id 的 id

StorageUnitInfo

属性
  • 容量

    number

    存储空间总量(以字节为单位)。

  • id

    字符串

    唯一标识存储设备的临时 ID。此 ID 在单个应用的同一运行时内保持不变。它不是应用的不同运行之间或不同应用之间的永久性标识符。

  • name

    字符串

    存储单元的名称。

  • 类型

    StorageUnitType

    存储单元的媒体类型。

StorageUnitType

枚举

"fixed"
存储具有固定介质,例如或 SSD。

"removable"
存储空间可移动,例如U 盘。

"unknown"
存储类型未知。

方法

ejectDevice()

<ph type="x-smartling-placeholder"></ph> 承诺

chrome.system.storage.ejectDevice(id: string,callback?: function,
)

弹出可移动存储设备。

参数
  • id

    字符串

  • callback

    函数(可选)

    callback 参数如下所示:

    (result: EjectDeviceResultCode) => void

chrome.system.storage  |  API  |  Chrome for Developers

二、chrome.system.storage api接口定义c++:

1、system_storage.idl

extensions\common\api\system_storage.idl

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.// Use the <code>chrome.system.storage</code> API to query storage device
// information and be notified when a removable storage device is attached and
// detached.
namespace system.storage {enum StorageUnitType {// The storage has fixed media, e.g. hard disk or SSD.fixed,// The storage is removable, e.g. USB flash drive.removable,// The storage type is unknown.unknown};dictionary StorageUnitInfo {// The transient ID that uniquely identifies the storage device.// This ID will be persistent within the same run of a single application.// It will not be a persistent identifier between different runs of an// application, or between different applications.DOMString id;// The name of the storage unit.DOMString name;// The media type of the storage unit.StorageUnitType type;// The total amount of the storage space, in bytes.double capacity;};dictionary StorageAvailableCapacityInfo {// A copied |id| of getAvailableCapacity function parameter |id|.DOMString id;// The available capacity of the storage device, in bytes.double availableCapacity;};[inline_doc] enum EjectDeviceResultCode {// The ejection command is successful -- the application can prompt the user// to remove the device.success,// The device is in use by another application. The ejection did not// succeed; the user should not remove the device until the other// application is done with the device.in_use,// There is no such device known.no_such_device,// The ejection command failed.failure};callback EjectDeviceCallback = void (EjectDeviceResultCode result);callback StorageInfoCallback = void (StorageUnitInfo[] info);callback GetAvailableCapacityCallback = void (StorageAvailableCapacityInfo info);interface Functions {// Get the storage information from the system. The argument passed to the// callback is an array of StorageUnitInfo objects.[supportsPromises] static void getInfo(StorageInfoCallback callback);// Ejects a removable storage device.[supportsPromises] static void ejectDevice(DOMString id,EjectDeviceCallback callback);// Get the available capacity of a specified |id| storage device.// The |id| is the transient device ID from StorageUnitInfo.[supportsPromises] static void getAvailableCapacity(DOMString id,GetAvailableCapacityCallback callback);};interface Events {// Fired when a new removable storage is attached to the system.static void onAttached(StorageUnitInfo info);// Fired when a removable storage is detached from the system.static void onDetached(DOMString id);};};

2、system_storage.idl 自动生成c++文件:

out\Debug\gen\extensions\common\api\system_storage.cc

out\Debug\gen\extensions\common\api\system_storage.h

3、chrome.system.storage api c++定义

extensions\browser\api\system_storage\system_storage_api.h

extensions\browser\api\system_storage\system_storage_api.cc

namespace extensions {// Implementation of the systeminfo.storage.get API. It is an asynchronous
// call relative to browser UI thread.
class SystemStorageGetInfoFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("system.storage.getInfo", SYSTEM_STORAGE_GETINFO)SystemStorageGetInfoFunction() = default;private:~SystemStorageGetInfoFunction() override = default;// ExtensionFunction:ResponseAction Run() override;void OnGetStorageInfoCompleted(bool success);
};class SystemStorageEjectDeviceFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("system.storage.ejectDevice",SYSTEM_STORAGE_EJECTDEVICE)protected:~SystemStorageEjectDeviceFunction() override = default;// ExtensionFunction:ResponseAction Run() override;private:void OnStorageMonitorInit(const std::string& transient_device_id);// Eject device request handler.void HandleResponse(storage_monitor::StorageMonitor::EjectStatus status);
};class SystemStorageGetAvailableCapacityFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("system.storage.getAvailableCapacity",SYSTEM_STORAGE_GETAVAILABLECAPACITY)SystemStorageGetAvailableCapacityFunction();private:void OnStorageMonitorInit(const std::string& transient_id);void OnQueryCompleted(const std::string& transient_id,double available_capacity);~SystemStorageGetAvailableCapacityFunction() override;// ExtensionFunction:ResponseAction Run() override;scoped_refptr<base::SequencedTaskRunner> query_runner_;
};}  // namespace extensions

http://www.mmbaike.com/news/99231.html

相关文章:

  • 网站建设服务怎么样爱网站查询挖掘工具
  • 盐田高端网站建设浙江企业seo推广
  • 做网站尺寸一般都多大谷歌google中文登录入口
  • 新闻网站规划建设整合营销传播的定义
  • 南京文化云网站建设中国大数据平台官网
  • 珍岛做网站怎么样重庆搜索排名提升
  • 网站设计培训课程重庆快速排名优化
  • 学院管理网站建设建立网站的步骤
  • 上海网站建设基础网络销售平台上市公司有哪些
  • 宜昌做网站的百度公司招聘条件
  • 支付网站建设费用做账seo学徒招聘
  • 凤岗东莞微信网站建设百度关键词点击工具
  • 深圳网站建设公司是梅州seo
  • 天水建设局网站渣土治理百度一下网页打开
  • wordpress获取自定义文章分类名网站seo哪里做的好
  • 专门做护肤品网站免费com域名注册网站
  • 桂林市网站设计零基础seo入门教学
  • 如何优化网站 提高排名营销培训课程ppt
  • 记事本做网站背景色怎么弄网络营销是什么专业类别
  • 怎么做网站相册东莞建设企业网站公司
  • 计算机毕业设计代做网站seo查询爱站网
  • 建设厅网站上传不了身份证全球十大搜索引擎排名及网址
  • 网站建设近义词湖北网站设计
  • wordpress获取图片原图搜索引擎营销就是seo
  • 网站设计制作 联系查询域名注册信息
  • 网站开发做什么的北京网络排名优化
  • 有空间与域名后怎么做网站创意营销策划方案
  • 两个域名同一个网站做优化数据分析一般用什么软件
  • 江苏省教育网站官网企业qq怎么申请注册
  • 网站seo设置是什么意思seo关键词布局