Commit 08d77f2b authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

Extensions: Remove screenlockPrivate API.

This is no longer used.

R=tbarzic@chromium.org

Bug: 904892
Test: none
Change-Id: Iac3088bdc2b198d0d5b37ab9cf18fba5c4c704c8
Reviewed-on: https://chromium-review.googlesource.com/c/1334331Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608821}
parent fc28aba9
...@@ -925,8 +925,6 @@ jumbo_static_library("extensions") { ...@@ -925,8 +925,6 @@ jumbo_static_library("extensions") {
"api/platform_keys/platform_keys_api.h", "api/platform_keys/platform_keys_api.h",
"api/platform_keys/verify_trust_api.cc", "api/platform_keys/verify_trust_api.cc",
"api/platform_keys/verify_trust_api.h", "api/platform_keys/verify_trust_api.h",
"api/screenlock_private/screenlock_private_api.cc",
"api/screenlock_private/screenlock_private_api.h",
"api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.cc", "api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.cc",
"api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.h", "api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.h",
"api/settings_private/chromeos_resolve_time_zone_by_geolocation_on_off.cc", "api/settings_private/chromeos_resolve_time_zone_by_geolocation_on_off.cc",
......
// Copyright 2013 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.
#include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h"
#include <memory>
#include <utility>
#include "base/lazy_instance.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/easy_unlock/chrome_proximity_auth_client.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/screenlock_private.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chromeos/components/proximity_auth/screenlock_bridge.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/event_router.h"
namespace extensions {
namespace screenlock = api::screenlock_private;
ScreenlockPrivateGetLockedFunction::ScreenlockPrivateGetLockedFunction() {}
ScreenlockPrivateGetLockedFunction::~ScreenlockPrivateGetLockedFunction() {}
bool ScreenlockPrivateGetLockedFunction::RunAsync() {
SetResult(std::make_unique<base::Value>(
proximity_auth::ScreenlockBridge::Get()->IsLocked()));
SendResponse(error_.empty());
return true;
}
ScreenlockPrivateSetLockedFunction::ScreenlockPrivateSetLockedFunction() {}
ScreenlockPrivateSetLockedFunction::~ScreenlockPrivateSetLockedFunction() {}
bool ScreenlockPrivateSetLockedFunction::RunAsync() {
std::unique_ptr<screenlock::SetLocked::Params> params(
screenlock::SetLocked::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
chromeos::EasyUnlockService* service =
chromeos::EasyUnlockService::Get(GetProfile());
if (params->locked) {
proximity_auth::ScreenlockBridge::Get()->Lock();
} else {
proximity_auth::ScreenlockBridge::Get()->Unlock(AccountId::FromUserEmail(
service->proximity_auth_client()->GetAuthenticatedUsername()));
}
SendResponse(error_.empty());
return true;
}
ScreenlockPrivateAcceptAuthAttemptFunction::
ScreenlockPrivateAcceptAuthAttemptFunction() {}
ScreenlockPrivateAcceptAuthAttemptFunction::
~ScreenlockPrivateAcceptAuthAttemptFunction() {}
ExtensionFunction::ResponseAction
ScreenlockPrivateAcceptAuthAttemptFunction::Run() {
std::unique_ptr<screenlock::AcceptAuthAttempt::Params> params(
screenlock::AcceptAuthAttempt::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
Profile* profile = Profile::FromBrowserContext(browser_context());
chromeos::EasyUnlockService* service =
chromeos::EasyUnlockService::Get(profile);
if (service)
service->FinalizeUnlock(params->accept);
return RespondNow(NoArguments());
}
ScreenlockPrivateEventRouter::ScreenlockPrivateEventRouter(
content::BrowserContext* context)
: browser_context_(context) {
proximity_auth::ScreenlockBridge::Get()->AddObserver(this);
}
ScreenlockPrivateEventRouter::~ScreenlockPrivateEventRouter() {}
void ScreenlockPrivateEventRouter::OnScreenDidLock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
DispatchEvent(events::SCREENLOCK_PRIVATE_ON_CHANGED,
screenlock::OnChanged::kEventName,
std::make_unique<base::Value>(true));
}
void ScreenlockPrivateEventRouter::OnScreenDidUnlock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
DispatchEvent(events::SCREENLOCK_PRIVATE_ON_CHANGED,
screenlock::OnChanged::kEventName,
std::make_unique<base::Value>(false));
}
void ScreenlockPrivateEventRouter::OnFocusedUserChanged(
const AccountId& account_id) {}
void ScreenlockPrivateEventRouter::DispatchEvent(
events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::Value> arg) {
std::unique_ptr<base::ListValue> args(new base::ListValue());
if (arg)
args->Append(std::move(arg));
std::unique_ptr<Event> event(
new Event(histogram_value, event_name, std::move(args)));
EventRouter::Get(browser_context_)->BroadcastEvent(std::move(event));
}
static base::LazyInstance<BrowserContextKeyedAPIFactory<
ScreenlockPrivateEventRouter>>::DestructorAtExit
g_screenlock_private_api_factory = LAZY_INSTANCE_INITIALIZER;
// static
BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>*
ScreenlockPrivateEventRouter::GetFactoryInstance() {
return g_screenlock_private_api_factory.Pointer();
}
void ScreenlockPrivateEventRouter::Shutdown() {
proximity_auth::ScreenlockBridge::Get()->RemoveObserver(this);
}
} // namespace extensions
// Copyright 2013 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.
#ifndef CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chromeos/components/proximity_auth/screenlock_bridge.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_event_histogram_value.h"
namespace extensions {
class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked",
SCREENLOCKPRIVATE_GETLOCKED)
ScreenlockPrivateGetLockedFunction();
bool RunAsync() override;
private:
~ScreenlockPrivateGetLockedFunction() override;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction);
};
class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked",
SCREENLOCKPRIVATE_SETLOCKED)
ScreenlockPrivateSetLockedFunction();
bool RunAsync() override;
private:
~ScreenlockPrivateSetLockedFunction() override;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction);
};
class ScreenlockPrivateAcceptAuthAttemptFunction
: public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt",
SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT)
ScreenlockPrivateAcceptAuthAttemptFunction();
ResponseAction Run() override;
private:
~ScreenlockPrivateAcceptAuthAttemptFunction() override;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateAcceptAuthAttemptFunction);
};
class ScreenlockPrivateEventRouter
: public BrowserContextKeyedAPI,
public proximity_auth::ScreenlockBridge::Observer {
public:
explicit ScreenlockPrivateEventRouter(content::BrowserContext* context);
~ScreenlockPrivateEventRouter() override;
// BrowserContextKeyedAPI
static BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>*
GetFactoryInstance();
void Shutdown() override;
private:
friend class BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>;
// proximity_auth::ScreenlockBridge::Observer
void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType
screen_type) override;
void OnScreenDidUnlock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type)
override;
void OnFocusedUserChanged(const AccountId& account_id) override;
// BrowserContextKeyedAPI
static const char* service_name() {
return "ScreenlockPrivateEventRouter";
}
static const bool kServiceIsNULLWhileTesting = true;
static const bool kServiceRedirectedInIncognito = true;
void DispatchEvent(events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::Value> arg);
content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter);
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_H_
// Copyright 2013 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.
#include <stddef.h>
#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chromeos/components/proximity_auth/screenlock_bridge.h"
#include "content/public/browser/notification_service.h"
#include "extensions/browser/api/test/test_api.h"
#include "extensions/browser/notification_types.h"
#include "extensions/common/switches.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/identity/public/cpp/identity_test_utils.h"
namespace extensions {
namespace {
const char kAttemptClickAuthMessage[] = "attemptClickAuth";
const char kTestExtensionId[] = "lkegkdgachcnekllcdfkijonogckdnjo";
const char kTestUser[] = "testuser@gmail.com";
} // namespace
class ScreenlockPrivateApiTest : public ExtensionApiTest,
public content::NotificationObserver {
public:
ScreenlockPrivateApiTest() {}
~ScreenlockPrivateApiTest() override {}
// ExtensionApiTest
void SetUpCommandLine(base::CommandLine* command_line) override {
ExtensionApiTest::SetUpCommandLine(command_line);
command_line->AppendSwitchASCII(
extensions::switches::kWhitelistedExtensionID, kTestExtensionId);
}
void SetUpOnMainThread() override {
identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(profile());
identity::MakePrimaryAccountAvailable(
SigninManagerFactory::GetForProfile(profile()),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile()),
identity_manager, kTestUser);
test_account_id_ = AccountId::FromUserEmailGaiaId(
kTestUser, identity_manager->GetPrimaryAccountInfo().gaia);
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE,
content::NotificationService::AllSources());
ExtensionApiTest::SetUpOnMainThread();
}
void TearDownOnMainThread() override {
ExtensionApiTest::TearDownOnMainThread();
registrar_.RemoveAll();
}
protected:
// content::NotificationObserver override:
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override {
const std::string& message =
content::Details<std::pair<std::string, bool*>>(details).ptr()->first;
if (message == kAttemptClickAuthMessage) {
proximity_auth::ScreenlockBridge::Get()->lock_handler()->SetAuthType(
test_account_id_, proximity_auth::mojom::AuthType::USER_CLICK,
base::string16());
chromeos::EasyUnlockService::Get(profile())->AttemptAuth(
test_account_id_);
}
}
// Loads |extension_name| and waits for a pass / fail notification.
void RunTest(const std::string& extension_name) {
ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_;
}
private:
AccountId test_account_id_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateApiTest);
};
// Locking is currently implemented only on ChromeOS.
#if defined(OS_CHROMEOS)
// Flaky under MSan. http://crbug.com/478091
#if defined(MEMORY_SANITIZER)
#define MAYBE_LockUnlock DISABLED_LockUnlock
#else
#define MAYBE_LockUnlock LockUnlock
#endif
IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, MAYBE_LockUnlock) {
RunTest("screenlock_private/lock_unlock");
}
#endif // defined(OS_CHROMEOS)
} // namespace extensions
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "chrome/browser/chromeos/extensions/input_method_api.h" #include "chrome/browser/chromeos/extensions/input_method_api.h"
#include "chrome/browser/chromeos/extensions/media_player_api.h" #include "chrome/browser/chromeos/extensions/media_player_api.h"
#include "chrome/browser/extensions/api/input_ime/input_ime_api.h" #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
#include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h"
#elif defined(OS_LINUX) || defined(OS_WIN) #elif defined(OS_LINUX) || defined(OS_WIN)
#include "chrome/browser/extensions/api/input_ime/input_ime_api.h" #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
#endif #endif
...@@ -116,9 +115,6 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() { ...@@ -116,9 +115,6 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
#endif #endif
extensions::PreferenceAPI::GetFactoryInstance(); extensions::PreferenceAPI::GetFactoryInstance();
extensions::ProcessesAPI::GetFactoryInstance(); extensions::ProcessesAPI::GetFactoryInstance();
#if defined(OS_CHROMEOS)
extensions::ScreenlockPrivateEventRouter::GetFactoryInstance();
#endif
extensions::SessionsAPI::GetFactoryInstance(); extensions::SessionsAPI::GetFactoryInstance();
extensions::SettingsPrivateEventRouterFactory::GetInstance(); extensions::SettingsPrivateEventRouterFactory::GetInstance();
extensions::SettingsOverridesAPI::GetFactoryInstance(); extensions::SettingsOverridesAPI::GetFactoryInstance();
......
...@@ -463,11 +463,6 @@ ...@@ -463,11 +463,6 @@
"dependencies": ["permission:fileBrowserHandler"], "dependencies": ["permission:fileBrowserHandler"],
"contexts": ["blessed_extension"] "contexts": ["blessed_extension"]
}, },
"screenlockPrivate": {
"dependencies": ["permission:screenlockPrivate"],
"extension_types": ["platform_app"],
"contexts": ["blessed_extension"]
},
"fileManagerPrivate": { "fileManagerPrivate": {
"dependencies": ["permission:fileManagerPrivate"], "dependencies": ["permission:fileManagerPrivate"],
"contexts": ["blessed_extension"] "contexts": ["blessed_extension"]
......
...@@ -676,12 +676,6 @@ ...@@ -676,12 +676,6 @@
"08455FA7CB8734168378F731B00B354CEEE0088F" // Chrome Reporting Ext. Beta "08455FA7CB8734168378F731B00B354CEEE0088F" // Chrome Reporting Ext. Beta
] ]
}, },
"screenlockPrivate": {
"channel": "stable",
"extension_types": ["platform_app"],
"location": "component",
"platforms": ["chromeos"]
},
"sessions": { "sessions": {
"channel": "stable", "channel": "stable",
"extension_types": ["extension", "legacy_packaged_app"] "extension_types": ["extension", "legacy_packaged_app"]
......
...@@ -105,7 +105,6 @@ if (is_chromeos) { ...@@ -105,7 +105,6 @@ if (is_chromeos) {
"platform_keys.idl", "platform_keys.idl",
"platform_keys_internal.idl", "platform_keys_internal.idl",
"quick_unlock_private.idl", "quick_unlock_private.idl",
"screenlock_private.idl",
"terminal_private.json", "terminal_private.json",
"users_private.idl", "users_private.idl",
"wallpaper.json", "wallpaper.json",
......
// Copyright 2013 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.
// Control and monitor the screen locker.
[permissions=screenlockPrivate, nodoc]
namespace screenlockPrivate {
// Supported authentication types shown on the user pod.
// |offlinePassword|: The standard password field, which authenticates using
// the user's regular password. The $(ref:onAuthAttempted)()
// event will not be fired for this authentication type.
// |numericPin|: An input field for a 4 digit numeric pin code.
// |userClick|: Makes the user pod clickable when it is focused, and
// clicking on it attempts the authentication. If |value| is
// specified with $(ref:setAuthType)(), the text is displayed
// in the password field.
enum AuthType {offlinePassword, numericPin, userClick};
callback BooleanCallback = void(boolean locked);
interface Functions {
// Returns true if the screen is currently locked, false otherwise.
static void getLocked(BooleanCallback callback);
// Set <code>locked=true</code> to lock the screen,
// <code>locked=false</code> to unlock it.
static void setLocked(boolean locked);
// Accepts or rejects the current auth attempt.
static void acceptAuthAttempt(boolean accept);
};
interface Events {
// Fires whenever the screen is locked or unlocked.
static void onChanged(boolean locked);
};
};
...@@ -1050,7 +1050,6 @@ ...@@ -1050,7 +1050,6 @@
[ [
404, 404,
"apps/private_apis.html", "apps/private_apis.html",
"apps/screenlockPrivate.html",
"target page not found" "target page not found"
], ],
[ [
...@@ -1823,7 +1822,6 @@ ...@@ -1823,7 +1822,6 @@
[ [
404, 404,
"extensions/private_apis.html", "extensions/private_apis.html",
"extensions/screenlockPrivate.html",
"target page not found" "target page not found"
], ],
[ [
......
...@@ -94,8 +94,6 @@ constexpr APIPermissionInfo::InitInfo permissions_to_register[] = { ...@@ -94,8 +94,6 @@ constexpr APIPermissionInfo::InitInfo permissions_to_register[] = {
{APIPermission::kWebNavigation, "webNavigation"}, {APIPermission::kWebNavigation, "webNavigation"},
// Register private permissions. // Register private permissions.
{APIPermission::kScreenlockPrivate, "screenlockPrivate",
APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kActivityLogPrivate, "activityLogPrivate", {APIPermission::kActivityLogPrivate, "activityLogPrivate",
APIPermissionInfo::kFlagCannotBeOptional}, APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kAutoTestPrivate, "autotestPrivate", {APIPermission::kAutoTestPrivate, "autotestPrivate",
......
...@@ -619,9 +619,6 @@ ChromePermissionMessageRule::GetAllRules() { ...@@ -619,9 +619,6 @@ ChromePermissionMessageRule::GetAllRules() {
{APIPermission::kCertificateProvider}, {APIPermission::kCertificateProvider},
{}}, {}},
{IDS_EXTENSION_PROMPT_WARNING_SCREENLOCK_PRIVATE,
{APIPermission::kScreenlockPrivate},
{}},
{IDS_EXTENSION_PROMPT_WARNING_ACTIVITY_LOG_PRIVATE, {IDS_EXTENSION_PROMPT_WARNING_ACTIVITY_LOG_PRIVATE,
{APIPermission::kActivityLogPrivate}, {APIPermission::kActivityLogPrivate},
{}}, {}},
......
...@@ -1784,7 +1784,6 @@ test("browser_tests") { ...@@ -1784,7 +1784,6 @@ test("browser_tests") {
"../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc", "../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc",
"../browser/extensions/api/networking_private/networking_private_apitest.cc", "../browser/extensions/api/networking_private/networking_private_apitest.cc",
"../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
"../browser/extensions/api/screenlock_private/screenlock_private_apitest.cc",
"../browser/extensions/api/vpn_provider/vpn_provider_apitest.cc", "../browser/extensions/api/vpn_provider/vpn_provider_apitest.cc",
"../browser/extensions/chromeos_component_extensions_browsertest.cc", "../browser/extensions/chromeos_component_extensions_browsertest.cc",
"../browser/notifications/chrome_ash_message_center_client_browsertest.cc", "../browser/notifications/chrome_ash_message_center_client_browsertest.cc",
......
{"name":"screenlockPrivate API test for locking and unlocking",
"description":"screenlockPrivate API test",
"key":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzw6Jj8oWCVA+04YVfiKl5Gq1eAhEfLoIUopf1JEohsAxOjR6DUq1RM5KHy+uepgFrvv3/t2GaMPhKZ4JA+S1nHQhOhCCf6DBEZyAeHVIqMPJVDovOO5xgzIJjbthaBN/P08jxVqvWiy6rGhjTwtS8Bl98LgSFlbezvlYE1qVwGyQ9mgUjw0Wv1+qi+yWQ5jSVmZisy/zy2AiMqu6dcQjp9cdmkuo5d+0o+a5yVzwfhuRfxEL2xhDvzVLwL/Y1s6IJj+FLirZ5K/SBZBhWRsqQ4aYbTFQge+KIVJflBpcRDpxxYaCbdnlzfBhRSCFV7X52KF0TyFJSsuKjFFpAQawGwIDAQAB",
"version":"1",
"manifest_version":2,
"permissions":["screenlockPrivate"],
"app":{"background":{"scripts":["test.js"]}}}
// Copyright 2014 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.
var stage = 0;
function step() {
chrome.screenlockPrivate.getLocked(function gotLocked(locked) {
if (stage === 0) {
if (locked) {
chrome.test.fail('locked at stage ' + stage);
} else {
chrome.screenlockPrivate.setLocked(true);
++stage;
return true;
}
} else if (stage === 1) {
if (!locked) {
chrome.test.fail('unlocked at stage ' + stage);
} else {
chrome.screenlockPrivate.setLocked(false);
++stage;
return true;
}
} else if (stage === 2) {
if (locked) {
chrome.test.fail('locked at stage ' + stage);
} else {
chrome.test.succeed();
}
}
});
};
chrome.screenlockPrivate.onChanged.addListener(function(locked) {
if (locked != (1 == (stage % 2))) {
chrome.test.fail((locked ? '' : 'un') + 'locked at stage ' + stage +
' onChanged');
} else {
return step();
}
});
chrome.test.runTests([
function testLockUnlock() {
step();
}
]);
...@@ -358,7 +358,7 @@ enum HistogramValue { ...@@ -358,7 +358,7 @@ enum HistogramValue {
DIAL_ON_ERROR = 337, DIAL_ON_ERROR = 337,
CAST_CHANNEL_ON_MESSAGE = 338, CAST_CHANNEL_ON_MESSAGE = 338,
CAST_CHANNEL_ON_ERROR = 339, CAST_CHANNEL_ON_ERROR = 339,
SCREENLOCK_PRIVATE_ON_CHANGED = 340, DELETED_SCREENLOCK_PRIVATE_ON_CHANGED = 340,
DELETED_SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED = 341, DELETED_SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED = 341,
TYPES_CHROME_SETTING_ON_CHANGE = 342, TYPES_CHROME_SETTING_ON_CHANGE = 342,
DELETED_TYPES_PRIVATE_CHROME_DIRECT_SETTING_ON_CHANGE = 343, DELETED_TYPES_PRIVATE_CHROME_DIRECT_SETTING_ON_CHANGE = 343,
......
...@@ -687,9 +687,9 @@ enum HistogramValue { ...@@ -687,9 +687,9 @@ enum HistogramValue {
BOOKMARKMANAGERPRIVATE_SETMETAINFO = 626, BOOKMARKMANAGERPRIVATE_SETMETAINFO = 626,
FILESYSTEMPROVIDER_MOUNT = 627, FILESYSTEMPROVIDER_MOUNT = 627,
AUTOTESTPRIVATE_GETEXTENSIONSINFO = 628, AUTOTESTPRIVATE_GETEXTENSIONSINFO = 628,
SCREENLOCKPRIVATE_GETLOCKED = 629, DELETED_SCREENLOCKPRIVATE_GETLOCKED = 629,
SCREENLOCKPRIVATE_SETLOCKED = 630, DELETED_SCREENLOCKPRIVATE_SETLOCKED = 630,
SCREENLOCKPRIVATE_SHOWMESSAGE = 631, DELETED_SCREENLOCKPRIVATE_SHOWMESSAGE = 631,
FEEDBACKPRIVATE_GETHISTOGRAMS = 632, FEEDBACKPRIVATE_GETHISTOGRAMS = 632,
SYSTEM_NETWORK_GETNETWORKINTERFACES = 633, SYSTEM_NETWORK_GETNETWORKINTERFACES = 633,
SERIAL_GETDEVICES = 634, SERIAL_GETDEVICES = 634,
...@@ -710,7 +710,7 @@ enum HistogramValue { ...@@ -710,7 +710,7 @@ enum HistogramValue {
MEDIAGALLERIES_GETMETADATA = 649, MEDIAGALLERIES_GETMETADATA = 649,
INPUT_IME_SENDKEYEVENTS = 650, INPUT_IME_SENDKEYEVENTS = 650,
VIRTUALKEYBOARDPRIVATE_LOCKKEYBOARD = 651, VIRTUALKEYBOARDPRIVATE_LOCKKEYBOARD = 651,
SCREENLOCKPRIVATE_SHOWCUSTOMICON = 652, DELETED_SCREENLOCKPRIVATE_SHOWCUSTOMICON = 652,
INPUT_IME_HIDEINPUTVIEW = 653, INPUT_IME_HIDEINPUTVIEW = 653,
BOOKMARKMANAGERPRIVATE_UNDO = 654, BOOKMARKMANAGERPRIVATE_UNDO = 654,
BOOKMARKMANAGERPRIVATE_REDO = 655, BOOKMARKMANAGERPRIVATE_REDO = 655,
...@@ -747,10 +747,10 @@ enum HistogramValue { ...@@ -747,10 +747,10 @@ enum HistogramValue {
ACTIVITYLOGPRIVATE_DELETEACTIVITIES = 686, ACTIVITYLOGPRIVATE_DELETEACTIVITIES = 686,
NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE = 687, NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE = 687,
NETWORKINGPRIVATE_GETWIFITDLSSTATUS = 688, NETWORKINGPRIVATE_GETWIFITDLSSTATUS = 688,
SCREENLOCKPRIVATE_HIDECUSTOMICON = 689, DELETED_SCREENLOCKPRIVATE_HIDECUSTOMICON = 689,
SCREENLOCKPRIVATE_SETAUTHTYPE = 690, DELETED_SCREENLOCKPRIVATE_SETAUTHTYPE = 690,
SCREENLOCKPRIVATE_GETAUTHTYPE = 691, DELETED_SCREENLOCKPRIVATE_GETAUTHTYPE = 691,
SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT = 692, DELETED_SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT = 692,
DELETED_WEBVIEW_FIND = 693, DELETED_WEBVIEW_FIND = 693,
DELETED_WEBVIEW_STOPFINDING = 694, DELETED_WEBVIEW_STOPFINDING = 694,
DELETED_WEBVIEW_CONTEXTMENUSCREATE = 695, DELETED_WEBVIEW_CONTEXTMENUSCREATE = 695,
......
...@@ -208,7 +208,7 @@ class APIPermission { ...@@ -208,7 +208,7 @@ class APIPermission {
kWebstoreWidgetPrivate = 164, kWebstoreWidgetPrivate = 164,
kWebView = 165, kWebView = 165,
kWindowShape = 166, kWindowShape = 166,
kScreenlockPrivate = 167, kDeleted_ScreenlockPrivate = 167,
kSystemCpu = 168, kSystemCpu = 168,
kSystemMemory = 169, kSystemMemory = 169,
kSystemNetwork = 170, kSystemNetwork = 170,
......
...@@ -182,7 +182,7 @@ class JsUtil(object): ...@@ -182,7 +182,7 @@ class JsUtil(object):
# documentation, rather than if it's a private API. Most private APIs # documentation, rather than if it's a private API. Most private APIs
# aren't documented, but some are. For example: # aren't documented, but some are. For example:
# - https://developer.chrome.com/apps/developerPrivate exists # - https://developer.chrome.com/apps/developerPrivate exists
# - https://developer.chrome.com/apps/screenlockPrivate does not # - https://developer.chrome.com/apps/mediaPlayerPrivate does not
if namespace_name.endswith('Private'): if namespace_name.endswith('Private'):
return return
......
...@@ -15825,7 +15825,7 @@ Called by update_net_error_codes.py.--> ...@@ -15825,7 +15825,7 @@ Called by update_net_error_codes.py.-->
<int value="337" label="DIAL_ON_ERROR"/> <int value="337" label="DIAL_ON_ERROR"/>
<int value="338" label="CAST_CHANNEL_ON_MESSAGE"/> <int value="338" label="CAST_CHANNEL_ON_MESSAGE"/>
<int value="339" label="CAST_CHANNEL_ON_ERROR"/> <int value="339" label="CAST_CHANNEL_ON_ERROR"/>
<int value="340" label="SCREENLOCK_PRIVATE_ON_CHANGED"/> <int value="340" label="DELETED_SCREENLOCK_PRIVATE_ON_CHANGED"/>
<int value="341" label="DELETED_SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED"/> <int value="341" label="DELETED_SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED"/>
<int value="342" label="TYPES_CHROME_SETTING_ON_CHANGE"/> <int value="342" label="TYPES_CHROME_SETTING_ON_CHANGE"/>
<int value="343" <int value="343"
...@@ -16576,9 +16576,9 @@ Called by update_net_error_codes.py.--> ...@@ -16576,9 +16576,9 @@ Called by update_net_error_codes.py.-->
<int value="626" label="BOOKMARKMANAGERPRIVATE_SETMETAINFO"/> <int value="626" label="BOOKMARKMANAGERPRIVATE_SETMETAINFO"/>
<int value="627" label="FILESYSTEMPROVIDER_MOUNT"/> <int value="627" label="FILESYSTEMPROVIDER_MOUNT"/>
<int value="628" label="AUTOTESTPRIVATE_GETEXTENSIONSINFO"/> <int value="628" label="AUTOTESTPRIVATE_GETEXTENSIONSINFO"/>
<int value="629" label="SCREENLOCKPRIVATE_GETLOCKED"/> <int value="629" label="DELETED_SCREENLOCKPRIVATE_GETLOCKED"/>
<int value="630" label="SCREENLOCKPRIVATE_SETLOCKED"/> <int value="630" label="DELETED_SCREENLOCKPRIVATE_SETLOCKED"/>
<int value="631" label="SCREENLOCKPRIVATE_SHOWMESSAGE"/> <int value="631" label="DELETED_SCREENLOCKPRIVATE_SHOWMESSAGE"/>
<int value="632" label="FEEDBACKPRIVATE_GETHISTOGRAMS"/> <int value="632" label="FEEDBACKPRIVATE_GETHISTOGRAMS"/>
<int value="633" label="SYSTEM_NETWORK_GETNETWORKINTERFACES"/> <int value="633" label="SYSTEM_NETWORK_GETNETWORKINTERFACES"/>
<int value="634" label="SERIAL_GETDEVICES"/> <int value="634" label="SERIAL_GETDEVICES"/>
...@@ -16600,7 +16600,7 @@ Called by update_net_error_codes.py.--> ...@@ -16600,7 +16600,7 @@ Called by update_net_error_codes.py.-->
<int value="649" label="MEDIAGALLERIES_GETMETADATA"/> <int value="649" label="MEDIAGALLERIES_GETMETADATA"/>
<int value="650" label="INPUT_IME_SENDKEYEVENTS"/> <int value="650" label="INPUT_IME_SENDKEYEVENTS"/>
<int value="651" label="VIRTUALKEYBOARDPRIVATE_LOCKKEYBOARD"/> <int value="651" label="VIRTUALKEYBOARDPRIVATE_LOCKKEYBOARD"/>
<int value="652" label="SCREENLOCKPRIVATE_SHOWCUSTOMICON"/> <int value="652" label="DELETED_SCREENLOCKPRIVATE_SHOWCUSTOMICON"/>
<int value="653" label="INPUT_IME_HIDEINPUTVIEW"/> <int value="653" label="INPUT_IME_HIDEINPUTVIEW"/>
<int value="654" label="BOOKMARKMANAGERPRIVATE_UNDO"/> <int value="654" label="BOOKMARKMANAGERPRIVATE_UNDO"/>
<int value="655" label="BOOKMARKMANAGERPRIVATE_REDO"/> <int value="655" label="BOOKMARKMANAGERPRIVATE_REDO"/>
...@@ -16638,10 +16638,10 @@ Called by update_net_error_codes.py.--> ...@@ -16638,10 +16638,10 @@ Called by update_net_error_codes.py.-->
<int value="686" label="ACTIVITYLOGPRIVATE_DELETEACTIVITIES"/> <int value="686" label="ACTIVITYLOGPRIVATE_DELETEACTIVITIES"/>
<int value="687" label="NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE"/> <int value="687" label="NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE"/>
<int value="688" label="NETWORKINGPRIVATE_GETWIFITDLSSTATUS"/> <int value="688" label="NETWORKINGPRIVATE_GETWIFITDLSSTATUS"/>
<int value="689" label="SCREENLOCKPRIVATE_HIDECUSTOMICON"/> <int value="689" label="DELETED_SCREENLOCKPRIVATE_HIDECUSTOMICON"/>
<int value="690" label="SCREENLOCKPRIVATE_SETAUTHTYPE"/> <int value="690" label="DELETED_SCREENLOCKPRIVATE_SETAUTHTYPE"/>
<int value="691" label="SCREENLOCKPRIVATE_GETAUTHTYPE"/> <int value="691" label="DELETED_SCREENLOCKPRIVATE_GETAUTHTYPE"/>
<int value="692" label="SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT"/> <int value="692" label="DELETED_SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT"/>
<int value="693" label="DELETED_WEBVIEW_FIND"/> <int value="693" label="DELETED_WEBVIEW_FIND"/>
<int value="694" label="DELETED_WEBVIEW_STOPFINDING"/> <int value="694" label="DELETED_WEBVIEW_STOPFINDING"/>
<int value="695" label="DELETED_WEBVIEW_CONTEXTMENUSCREATE"/> <int value="695" label="DELETED_WEBVIEW_CONTEXTMENUSCREATE"/>
...@@ -17524,7 +17524,7 @@ Called by update_net_error_codes.py.--> ...@@ -17524,7 +17524,7 @@ Called by update_net_error_codes.py.-->
<int value="54" label="kSearchProvider"/> <int value="54" label="kSearchProvider"/>
<int value="55" label="kStartupPages"/> <int value="55" label="kStartupPages"/>
<int value="56" label="kMediaGalleriesAllGalleriesDelete"/> <int value="56" label="kMediaGalleriesAllGalleriesDelete"/>
<int value="57" label="kScreenlockPrivate"/> <int value="57" label="kDeleted_ScreenlockPrivate"/>
<int value="58" label="kOverrideBookmarksUI"/> <int value="58" label="kOverrideBookmarksUI"/>
<int value="59" label="kAutomation"/> <int value="59" label="kAutomation"/>
<int value="60" label="kAccessibilityFeaturesModify"/> <int value="60" label="kAccessibilityFeaturesModify"/>
...@@ -17724,7 +17724,7 @@ Called by update_net_error_codes.py.--> ...@@ -17724,7 +17724,7 @@ Called by update_net_error_codes.py.-->
<int value="164" label="kWebstoreWidgetPrivate"/> <int value="164" label="kWebstoreWidgetPrivate"/>
<int value="165" label="kWebView"/> <int value="165" label="kWebView"/>
<int value="166" label="kWindowShape"/> <int value="166" label="kWindowShape"/>
<int value="167" label="kScreenlockPrivate"/> <int value="167" label="kDeleted_ScreenlockPrivate"/>
<int value="168" label="kSystemCpu"/> <int value="168" label="kSystemCpu"/>
<int value="169" label="kSystemMemory"/> <int value="169" label="kSystemMemory"/>
<int value="170" label="kSystemNetwork"/> <int value="170" label="kSystemNetwork"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment