This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhuyujia-webhopper/collector/adg-linux/gen/extensions/common/api/idle.h
little_stone bd2d50cf35 code update
2022-05-05 20:41:28 +08:00

104 lines
1.9 KiB
C++
Executable File

// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// GENERATED FROM THE API DEFINITION IN
// extensions/common/api/idle.json
// DO NOT EDIT.
#ifndef EXTENSIONS_COMMON_API_IDLE_H__
#define EXTENSIONS_COMMON_API_IDLE_H__
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/logging.h"
#include "base/values.h"
namespace extensions {
namespace api {
namespace idle {
//
// Types
//
enum IdleState {
IDLE_STATE_NONE,
IDLE_STATE_ACTIVE,
IDLE_STATE_IDLE,
IDLE_STATE_LOCKED,
IDLE_STATE_LAST = IDLE_STATE_LOCKED,
};
const char* ToString(IdleState as_enum);
IdleState ParseIdleState(const std::string& as_string);
//
// Functions
//
namespace QueryState {
struct Params {
static std::unique_ptr<Params> Create(const base::ListValue& args);
~Params();
// The system is considered idle if detectionIntervalInSeconds seconds have
// elapsed since the last user input detected.
int detection_interval_in_seconds;
private:
Params();
DISALLOW_COPY_AND_ASSIGN(Params);
};
namespace Results {
std::unique_ptr<base::ListValue> Create(const IdleState& new_state);
} // namespace Results
} // namespace QueryState
namespace SetDetectionInterval {
struct Params {
static std::unique_ptr<Params> Create(const base::ListValue& args);
~Params();
// Threshold, in seconds, used to determine when the system is in an idle state.
int interval_in_seconds;
private:
Params();
DISALLOW_COPY_AND_ASSIGN(Params);
};
} // namespace SetDetectionInterval
//
// Events
//
namespace OnStateChanged {
extern const char kEventName[]; // "idle.onStateChanged"
std::unique_ptr<base::ListValue> Create(const IdleState& new_state);
} // namespace OnStateChanged
} // namespace idle
} // namespace api
} // namespace extensions
#endif // EXTENSIONS_COMMON_API_IDLE_H__