Commit 82bf980c authored by tengs's avatar tengs Committed by Commit bot

Introduce new chrome.easyUnlock APIs for getting the sign-in challenge and...

Introduce new chrome.easyUnlock APIs for getting the sign-in challenge and using it to sign in the user.

BUG=401636

Review URL: https://codereview.chromium.org/552893002

Cr-Commit-Position: refs/heads/master@{#294317}
parent c478e9cc
...@@ -546,5 +546,33 @@ bool EasyUnlockPrivateGetRemoteDevicesFunction::RunSync() { ...@@ -546,5 +546,33 @@ bool EasyUnlockPrivateGetRemoteDevicesFunction::RunSync() {
return true; return true;
} }
EasyUnlockPrivateGetSignInChallengeFunction::
EasyUnlockPrivateGetSignInChallengeFunction() {
}
EasyUnlockPrivateGetSignInChallengeFunction::
~EasyUnlockPrivateGetSignInChallengeFunction() {
}
bool EasyUnlockPrivateGetSignInChallengeFunction::RunAsync() {
SetError("Not implemented");
SendResponse(false);
return true;
}
EasyUnlockPrivateTrySignInSecretFunction::
EasyUnlockPrivateTrySignInSecretFunction() {
}
EasyUnlockPrivateTrySignInSecretFunction::
~EasyUnlockPrivateTrySignInSecretFunction() {
}
bool EasyUnlockPrivateTrySignInSecretFunction::RunAsync() {
SetError("Not implemented");
SendResponse(false);
return true;
}
} // namespace api } // namespace api
} // namespace extensions } // namespace extensions
...@@ -277,6 +277,38 @@ class EasyUnlockPrivateGetRemoteDevicesFunction : public SyncExtensionFunction { ...@@ -277,6 +277,38 @@ class EasyUnlockPrivateGetRemoteDevicesFunction : public SyncExtensionFunction {
DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateGetRemoteDevicesFunction); DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateGetRemoteDevicesFunction);
}; };
class EasyUnlockPrivateGetSignInChallengeFunction :
public AsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.getSignInChallenge",
EASYUNLOCKPRIVATE_GETSIGNINCHALLENGE)
EasyUnlockPrivateGetSignInChallengeFunction();
private:
virtual ~EasyUnlockPrivateGetSignInChallengeFunction();
// AsyncExtensionFunction:
virtual bool RunAsync() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateGetSignInChallengeFunction);
};
class EasyUnlockPrivateTrySignInSecretFunction :
public AsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.trySignInSecret",
EASYUNLOCKPRIVATE_TRYSIGNINSECRET)
EasyUnlockPrivateTrySignInSecretFunction();
private:
virtual ~EasyUnlockPrivateTrySignInSecretFunction();
// AsyncExtensionFunction:
virtual bool RunAsync() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateTrySignInSecretFunction);
};
} // namespace api } // namespace api
} // namespace extensions } // namespace extensions
......
...@@ -259,5 +259,14 @@ ...@@ -259,5 +259,14 @@
// Gets the remote device list. // Gets the remote device list.
static void getRemoteDevices(GetRemoteDevicesCallback callback); static void getRemoteDevices(GetRemoteDevicesCallback callback);
// Gets the sign-in challenge for the current user.
static void getSignInChallenge(DataCallback callback);
// Tries to sign-in the current user with a secret obtained by decrypting
// the sign-in challenge. Check chrome.runtime.lastError for failures. Upon
// success, the user session will be started.
static void trySignInSecret(ArrayBuffer signInSecret,
EmptyCallback callback);
}; };
}; };
...@@ -949,6 +949,8 @@ enum HistogramValue { ...@@ -949,6 +949,8 @@ enum HistogramValue {
MEDIAGALLERIES_REMOVEALLGALLERYWATCH, MEDIAGALLERIES_REMOVEALLGALLERYWATCH,
MANAGEMENT_GETSELF, MANAGEMENT_GETSELF,
APP_CURRENTWINDOWINTERNAL_SETVISIBLEONALLWORKSPACES, APP_CURRENTWINDOWINTERNAL_SETVISIBLEONALLWORKSPACES,
EASYUNLOCKPRIVATE_GETSIGNINCHALLENGE,
EASYUNLOCKPRIVATE_TRYSIGNINSECRET,
// Last entry: Add new entries above and ensure to update // Last entry: Add new entries above and ensure to update
// tools/metrics/histograms/histograms.xml. // tools/metrics/histograms/histograms.xml.
ENUM_BOUNDARY ENUM_BOUNDARY
......
...@@ -41485,6 +41485,8 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -41485,6 +41485,8 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="888" label="MEDIAGALLERIES_REMOVEALLGALLERYWATCH"/> <int value="888" label="MEDIAGALLERIES_REMOVEALLGALLERYWATCH"/>
<int value="889" label="MANAGEMENT_GETSELF"/> <int value="889" label="MANAGEMENT_GETSELF"/>
<int value="890" label="APP_CURRENTWINDOWINTERNAL_SETVISIBLEONALLWORKSPACES"/> <int value="890" label="APP_CURRENTWINDOWINTERNAL_SETVISIBLEONALLWORKSPACES"/>
<int value="891" label="EASYUNLOCKPRIVATE_GETSIGNINCHALLENGE"/>
<int value="892" label="EASYUNLOCKPRIVATE_TRYSIGNINSECRET"/>
</enum> </enum>
<enum name="ExtensionInstallCause" type="int"> <enum name="ExtensionInstallCause" type="int">
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