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

Unified Diff: components/password_manager/content/public/type_converters.h

Issue 1762603002: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Impl done, unit_tests and browser_tests not ready yet Created 4 years, 9 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: components/password_manager/content/public/type_converters.h
diff --git a/components/password_manager/content/public/type_converters.h b/components/password_manager/content/public/type_converters.h
new file mode 100644
index 0000000000000000000000000000000000000000..6918cc07bc6984d76491e127d10494b3d06fa060
--- /dev/null
+++ b/components/password_manager/content/public/type_converters.h
@@ -0,0 +1,53 @@
+// Copyright 2016 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 COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_TYPE_CONVERTERS_IMPL_H_
+#define COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_TYPE_CONVERTERS_IMPL_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "components/password_manager/content/public/interfaces/credential_manager.mojom.h"
+
+namespace blink {
+class WebCredential;
+}
+
+namespace password_manager {
+struct CredentialInfo;
+}
+
+using BlinkWebCredentialPtr = scoped_ptr<blink::WebCredential>;
vabr (Chromium) 2016/03/09 16:26:29 Is there any special reason to use this alias? If
leonhsl(Using Gerrit) 2016/03/10 06:42:42 Done.
+
+namespace mojo {
+
+template <>
+struct TypeConverter<password_manager::mojom::CredentialInfoPtr,
+ password_manager::CredentialInfo> {
+ static password_manager::mojom::CredentialInfoPtr Convert(
+ const password_manager::CredentialInfo& input);
+};
+
+template <>
+struct TypeConverter<password_manager::CredentialInfo,
+ password_manager::mojom::CredentialInfoPtr> {
+ static password_manager::CredentialInfo Convert(
+ const password_manager::mojom::CredentialInfoPtr& input);
+};
+
+template <>
+struct TypeConverter<password_manager::mojom::CredentialInfoPtr,
+ blink::WebCredential> {
+ static password_manager::mojom::CredentialInfoPtr Convert(
+ const blink::WebCredential& input);
+};
+
+template <>
+struct TypeConverter<BlinkWebCredentialPtr,
+ password_manager::mojom::CredentialInfoPtr> {
+ static BlinkWebCredentialPtr Convert(
+ const password_manager::mojom::CredentialInfoPtr& input);
+};
+
+} // namespace mojo
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_TYPE_CONVERTERS_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698