This source file includes following definitions.
- RunImpl
- RunImpl
#include "chrome/browser/extensions/api/power/power_api.h"
#include "chrome/browser/extensions/api/power/power_api_manager.h"
#include "chrome/common/extensions/api/power.h"
namespace extensions {
bool PowerRequestKeepAwakeFunction::RunImpl() {
scoped_ptr<api::power::RequestKeepAwake::Params> params(
api::power::RequestKeepAwake::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
EXTENSION_FUNCTION_VALIDATE(params->level != api::power::LEVEL_NONE);
PowerApiManager::GetInstance()->AddRequest(extension_id(), params->level);
return true;
}
bool PowerReleaseKeepAwakeFunction::RunImpl() {
PowerApiManager::GetInstance()->RemoveRequest(extension_id());
return true;
}
}