Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: chrome/browser/chromeos/platform_keys/platform_keys_service.cc

Issue 927293002: platformKeys: Hook up the certificate selection dialog to selectClientCertificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_perms
Patch Set: Rebased. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/platform_keys/platform_keys_service.cc
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
index 01abc1ae0661865d7d969651ad9cd91812623cc2..34228d3b0f2c168299a831d5fe79e4d181a1215f 100644
--- a/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
+++ b/chrome/browser/chromeos/platform_keys/platform_keys_service.cc
@@ -427,11 +427,13 @@ class PlatformKeysService::SelectTask : public Task {
bool interactive,
const std::string& extension_id,
const SelectCertificatesCallback& callback,
+ content::WebContents* web_contents,
PlatformKeysService* service)
: request_(request),
interactive_(interactive),
extension_id_(extension_id),
callback_(callback),
+ web_contents_(web_contents),
service_(service),
weak_factory_(this) {}
~SelectTask() override {}
@@ -512,12 +514,13 @@ class PlatformKeysService::SelectTask : public Task {
}
service_->select_delegate_->Select(
extension_id_, matches_,
- base::Bind(&SelectTask::GotSelection, base::Unretained(this)));
+ base::Bind(&SelectTask::GotSelection, base::Unretained(this)),
+ web_contents_, service_->browser_context_);
}
// Will be called by |SelectCerts()| with the selected cert or null if no cert
// was selected.
- void GotSelection(scoped_refptr<net::X509Certificate> selected_cert) {
+ void GotSelection(const scoped_refptr<net::X509Certificate>& selected_cert) {
selected_cert_ = selected_cert;
DoStep();
}
@@ -601,6 +604,7 @@ class PlatformKeysService::SelectTask : public Task {
const bool interactive_;
const std::string extension_id_;
const SelectCertificatesCallback callback_;
+ content::WebContents* const web_contents_;
PlatformKeysService* const service_;
base::WeakPtrFactory<SelectTask> weak_factory_;
@@ -684,10 +688,11 @@ void PlatformKeysService::SelectClientCertificates(
const platform_keys::ClientCertificateRequest& request,
bool interactive,
const std::string& extension_id,
- const SelectCertificatesCallback& callback) {
+ const SelectCertificatesCallback& callback,
+ content::WebContents* web_contents) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- StartOrQueueTask(make_scoped_ptr(
- new SelectTask(request, interactive, extension_id, callback, this)));
+ StartOrQueueTask(make_scoped_ptr(new SelectTask(
+ request, interactive, extension_id, callback, web_contents, this)));
}
void PlatformKeysService::StartOrQueueTask(scoped_ptr<Task> task) {

Powered by Google App Engine
This is Rietveld 408576698