-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SmartCard: ChromeOsSmartCardDelegate
Provide a SmartCardDelegate implementation on ChromeOS On ChromeOS, smart cards are provided by an extension, via the chrome.smartCardProviderPrivate extension API. go/web-smart-card-hld Low-Coverage-Reason: There are tests for the part above SmartCardDelegate (SmartCardService, SmartCardReaderTracker, Web API) and the part below it (SmartCardProviderPrivateApi). This CL connects parts together. Bug: 1386175 Change-Id: I439a45019ce10402e66e6926037668c05ebc0e94 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4353054 Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Daniel d'Andrada <dandrader@google.com> Cr-Commit-Position: refs/heads/main@{#1122444}
- Loading branch information
Showing
10 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2023 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
source_set("smart_card") { | ||
if (is_chromeos) { | ||
sources = [ | ||
"chromeos_smart_card_delegate.cc", | ||
"chromeos_smart_card_delegate.h", | ||
] | ||
deps = [ | ||
"//chrome/browser/chromeos/extensions/smart_card_provider_private", | ||
"//content/public/browser:browser", | ||
] | ||
} | ||
# TODO(crbug.com/1386175): Add chrome_smart_card_delegate.* for Win/Mac/Linux | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Metadata information for this directory. | ||
# | ||
# For more information on DIR_METADATA files, see: | ||
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md | ||
# | ||
# For the schema of this file, see Metadata message: | ||
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto | ||
|
||
monorail { | ||
component: "Blink>SmartCard" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file://third_party/blink/renderer/modules/smart_card/OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/smart_card/chromeos_smart_card_delegate.h" | ||
#include "chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h" | ||
|
||
ChromeOsSmartCardDelegate::ChromeOsSmartCardDelegate() = default; | ||
|
||
mojo::PendingRemote<device::mojom::SmartCardContextFactory> | ||
ChromeOsSmartCardDelegate::GetSmartCardContextFactory( | ||
content::BrowserContext& browser_context) { | ||
return extensions::SmartCardProviderPrivateAPI::Get(browser_context) | ||
.GetSmartCardContextFactory(); | ||
} | ||
|
||
bool ChromeOsSmartCardDelegate::SupportsReaderAddedRemovedNotifications() | ||
const { | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_SMART_CARD_CHROMEOS_SMART_CARD_DELEGATE_H_ | ||
#define CHROME_BROWSER_SMART_CARD_CHROMEOS_SMART_CARD_DELEGATE_H_ | ||
|
||
#include "content/public/browser/smart_card_delegate.h" | ||
|
||
class ChromeOsSmartCardDelegate : public content::SmartCardDelegate { | ||
public: | ||
ChromeOsSmartCardDelegate(); | ||
|
||
// `content::SmartCardDelegate` overrides: | ||
mojo::PendingRemote<device::mojom::SmartCardContextFactory> | ||
GetSmartCardContextFactory(content::BrowserContext& browser_context) override; | ||
bool SupportsReaderAddedRemovedNotifications() const override; | ||
}; | ||
|
||
#endif // CHROME_BROWSER_SMART_CARD_CHROMEOS_SMART_CARD_DELEGATE_H_ |