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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Addressed comments from rockot@. Created 3 years, 6 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 98cac7fca468d37ccf44e6803294ea5fa53f4f28..63deb49bee9b77ac24b93a25ed8d8af37d9bb5a8 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -198,6 +198,7 @@
#include "media/audio/audio_manager.h"
#include "media/media_features.h"
#include "media/mojo/features.h"
+#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
#include "net/base/mime_util.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_options.h"
@@ -2993,6 +2994,22 @@ void ChromeContentBrowserClient::BindInterfaceRequestFromFrame(
}
}
+bool ChromeContentBrowserClient::BindAssociatedInterfaceRequestFromFrame(
+ content::RenderFrameHost* render_frame_host,
+ const std::string& interface_name,
+ mojo::ScopedInterfaceEndpointHandle* handle) {
+ // TODO(https://crbug.com/736357): Factor AssociatedInterfaceRegistryImpl out
+ // into content/public/ so it can be used here instead of this abomination.
+ if (interface_name == password_manager::mojom::CredentialManager::Name_) {
+ ChromePasswordManagerClient::BindCredentialManager(
+ password_manager::mojom::CredentialManagerAssociatedRequest(
+ std::move(*handle)),
+ render_frame_host);
+ return true;
+ }
+ return false;
+}
+
void ChromeContentBrowserClient::BindInterfaceRequest(
const service_manager::BindSourceInfo& source_info,
const std::string& interface_name,
@@ -3324,8 +3341,6 @@ void ChromeContentBrowserClient::InitFrameInterfaces() {
frame_interfaces_->AddInterface<bluetooth::mojom::AdapterFactory>(
base::Bind(&bluetooth::AdapterFactory::Create));
- frame_interfaces_parameterized_->AddInterface(
- base::Bind(&ChromePasswordManagerClient::BindCredentialManager));
frame_interfaces_parameterized_->AddInterface(
base::Bind(&ChromeTranslateClient::BindContentTranslateDriver));

Powered by Google App Engine
This is Rietveld 408576698