+ ->set_api_key(extension_id(), params->api_key);
+ return RespondNow(NoArguments());
+}
+
+// CopresenceSetAuthTokenFunction implementation
+ExtensionFunction::ResponseAction CopresenceSetAuthTokenFunction::Run() {
+ scoped_ptr<api::copresence::SetAuthToken::Params> params(
+ api::copresence::SetAuthToken::Params::Create(*args_));
+ EXTENSION_FUNCTION_VALIDATE(params.get());
+
+ // The token may be set to empty, to clear it.
+ // TODO(ckehoe): Scope the auth token appropriately (crbug/423517).
+ CopresenceService::GetFactoryInstance()->Get(browser_context())
+ ->set_auth_token(params->token);