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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Address nit from clamy@. Created 3 years, 5 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 9d7732eaafb67fdab7e9ed9ddae4f5beb0749cb3..1466eac5726a39edc75e4ab1241fbd935f0045b2 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -200,6 +200,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"
@@ -2992,6 +2993,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,
@@ -3323,8 +3340,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));
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/password_manager/chrome_password_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698