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

Side by Side Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 518643002: Add ability to pass decryption key id to CreateSecureMessage method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ api.h" 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 GetCryptoDelegate(browser_context())->CreateSecureMessage( 318 GetCryptoDelegate(browser_context())->CreateSecureMessage(
319 params->payload, 319 params->payload,
320 params->key, 320 params->key,
321 params->options.associated_data ? 321 params->options.associated_data ?
322 *params->options.associated_data : std::string(), 322 *params->options.associated_data : std::string(),
323 params->options.public_metadata ? 323 params->options.public_metadata ?
324 *params->options.public_metadata : std::string(), 324 *params->options.public_metadata : std::string(),
325 params->options.verification_key_id ? 325 params->options.verification_key_id ?
326 *params->options.verification_key_id : std::string(), 326 *params->options.verification_key_id : std::string(),
327 params->options.decryption_key_id ?
328 *params->options.decryption_key_id : std::string(),
327 params->options.encrypt_type, 329 params->options.encrypt_type,
328 params->options.sign_type, 330 params->options.sign_type,
329 base::Bind(&EasyUnlockPrivateCreateSecureMessageFunction::OnData, 331 base::Bind(&EasyUnlockPrivateCreateSecureMessageFunction::OnData,
330 this)); 332 this));
331 return true; 333 return true;
332 } 334 }
333 335
334 void EasyUnlockPrivateCreateSecureMessageFunction::OnData( 336 void EasyUnlockPrivateCreateSecureMessageFunction::OnData(
335 const std::string& message) { 337 const std::string& message) {
336 // TODO(tbarzic): Improve error handling. 338 // TODO(tbarzic): Improve error handling.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 bool EasyUnlockPrivateGetRemoteDevicesFunction::RunSync() { 541 bool EasyUnlockPrivateGetRemoteDevicesFunction::RunSync() {
540 Profile* profile = Profile::FromBrowserContext(browser_context()); 542 Profile* profile = Profile::FromBrowserContext(browser_context());
541 const base::ListValue* devices = 543 const base::ListValue* devices =
542 EasyUnlockService::Get(profile)->GetRemoteDevices(); 544 EasyUnlockService::Get(profile)->GetRemoteDevices();
543 SetResult(devices ? devices->DeepCopy() : new base::ListValue()); 545 SetResult(devices ? devices->DeepCopy() : new base::ListValue());
544 return true; 546 return true;
545 } 547 }
546 548
547 } // namespace api 549 } // namespace api
548 } // namespace extensions 550 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698