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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 #include "content/public/common/web_preferences.h" 193 #include "content/public/common/web_preferences.h"
194 #include "device/bluetooth/adapter_factory.h" 194 #include "device/bluetooth/adapter_factory.h"
195 #include "device/bluetooth/public/interfaces/adapter.mojom.h" 195 #include "device/bluetooth/public/interfaces/adapter.mojom.h"
196 #include "device/usb/public/interfaces/chooser_service.mojom.h" 196 #include "device/usb/public/interfaces/chooser_service.mojom.h"
197 #include "device/usb/public/interfaces/device_manager.mojom.h" 197 #include "device/usb/public/interfaces/device_manager.mojom.h"
198 #include "extensions/features/features.h" 198 #include "extensions/features/features.h"
199 #include "gpu/config/gpu_switches.h" 199 #include "gpu/config/gpu_switches.h"
200 #include "media/audio/audio_manager.h" 200 #include "media/audio/audio_manager.h"
201 #include "media/media_features.h" 201 #include "media/media_features.h"
202 #include "media/mojo/features.h" 202 #include "media/mojo/features.h"
203 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
203 #include "net/base/mime_util.h" 204 #include "net/base/mime_util.h"
204 #include "net/cookies/canonical_cookie.h" 205 #include "net/cookies/canonical_cookie.h"
205 #include "net/cookies/cookie_options.h" 206 #include "net/cookies/cookie_options.h"
206 #include "net/ssl/ssl_cert_request_info.h" 207 #include "net/ssl/ssl_cert_request_info.h"
207 #include "ppapi/features/features.h" 208 #include "ppapi/features/features.h"
208 #include "ppapi/host/ppapi_host.h" 209 #include "ppapi/host/ppapi_host.h"
209 #include "printing/features/features.h" 210 #include "printing/features/features.h"
210 #include "services/preferences/public/interfaces/preferences.mojom.h" 211 #include "services/preferences/public/interfaces/preferences.mojom.h"
211 #include "services/service_manager/public/cpp/binder_registry.h" 212 #include "services/service_manager/public/cpp/binder_registry.h"
212 #include "services/service_manager/public/cpp/interface_provider.h" 213 #include "services/service_manager/public/cpp/interface_provider.h"
(...skipping 2772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 if (frame_interfaces_parameterized_->CanBindInterface(interface_name)) { 2986 if (frame_interfaces_parameterized_->CanBindInterface(interface_name)) {
2986 frame_interfaces_parameterized_->BindInterface(source_info, interface_name, 2987 frame_interfaces_parameterized_->BindInterface(source_info, interface_name,
2987 std::move(interface_pipe), 2988 std::move(interface_pipe),
2988 render_frame_host); 2989 render_frame_host);
2989 } else if (frame_interfaces_->CanBindInterface(interface_name)) { 2990 } else if (frame_interfaces_->CanBindInterface(interface_name)) {
2990 frame_interfaces_->BindInterface(source_info, interface_name, 2991 frame_interfaces_->BindInterface(source_info, interface_name,
2991 std::move(interface_pipe)); 2992 std::move(interface_pipe));
2992 } 2993 }
2993 } 2994 }
2994 2995
2996 bool ChromeContentBrowserClient::BindAssociatedInterfaceRequestFromFrame(
2997 content::RenderFrameHost* render_frame_host,
2998 const std::string& interface_name,
2999 mojo::ScopedInterfaceEndpointHandle* handle) {
3000 // TODO(https://crbug.com/736357): Factor AssociatedInterfaceRegistryImpl out
3001 // into content/public/ so it can be used here instead of this abomination.
3002 if (interface_name == password_manager::mojom::CredentialManager::Name_) {
3003 ChromePasswordManagerClient::BindCredentialManager(
3004 password_manager::mojom::CredentialManagerAssociatedRequest(
3005 std::move(*handle)),
3006 render_frame_host);
3007 return true;
3008 }
3009 return false;
3010 }
3011
2995 void ChromeContentBrowserClient::BindInterfaceRequest( 3012 void ChromeContentBrowserClient::BindInterfaceRequest(
2996 const service_manager::BindSourceInfo& source_info, 3013 const service_manager::BindSourceInfo& source_info,
2997 const std::string& interface_name, 3014 const std::string& interface_name,
2998 mojo::ScopedMessagePipeHandle* interface_pipe) { 3015 mojo::ScopedMessagePipeHandle* interface_pipe) {
2999 if (source_info.identity.name() == content::mojom::kGpuServiceName && 3016 if (source_info.identity.name() == content::mojom::kGpuServiceName &&
3000 gpu_binder_registry_.CanBindInterface(interface_name)) { 3017 gpu_binder_registry_.CanBindInterface(interface_name)) {
3001 gpu_binder_registry_.BindInterface(source_info, interface_name, 3018 gpu_binder_registry_.BindInterface(source_info, interface_name,
3002 std::move(*interface_pipe)); 3019 std::move(*interface_pipe));
3003 } 3020 }
3004 } 3021 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 frame_interfaces_parameterized_->AddInterface( 3334 frame_interfaces_parameterized_->AddInterface(
3318 base::Bind(&CreateUsbDeviceManager)); 3335 base::Bind(&CreateUsbDeviceManager));
3319 frame_interfaces_parameterized_->AddInterface( 3336 frame_interfaces_parameterized_->AddInterface(
3320 base::Bind(&CreateWebUsbChooserService)); 3337 base::Bind(&CreateWebUsbChooserService));
3321 } 3338 }
3322 3339
3323 frame_interfaces_->AddInterface<bluetooth::mojom::AdapterFactory>( 3340 frame_interfaces_->AddInterface<bluetooth::mojom::AdapterFactory>(
3324 base::Bind(&bluetooth::AdapterFactory::Create)); 3341 base::Bind(&bluetooth::AdapterFactory::Create));
3325 3342
3326 frame_interfaces_parameterized_->AddInterface( 3343 frame_interfaces_parameterized_->AddInterface(
3327 base::Bind(&ChromePasswordManagerClient::BindCredentialManager));
3328 frame_interfaces_parameterized_->AddInterface(
3329 base::Bind(&ChromeTranslateClient::BindContentTranslateDriver)); 3344 base::Bind(&ChromeTranslateClient::BindContentTranslateDriver));
3330 3345
3331 frame_interfaces_parameterized_->AddInterface( 3346 frame_interfaces_parameterized_->AddInterface(
3332 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver)); 3347 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver));
3333 3348
3334 frame_interfaces_parameterized_->AddInterface( 3349 frame_interfaces_parameterized_->AddInterface(
3335 base::Bind(&password_manager::ContentPasswordManagerDriverFactory:: 3350 base::Bind(&password_manager::ContentPasswordManagerDriverFactory::
3336 BindPasswordManagerDriver)); 3351 BindPasswordManagerDriver));
3337 3352
3338 frame_interfaces_parameterized_->AddInterface( 3353 frame_interfaces_parameterized_->AddInterface(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3464 // displayed URL when rewriting chrome://help to chrome://settings/help. 3479 // displayed URL when rewriting chrome://help to chrome://settings/help.
3465 return url->SchemeIs(content::kChromeUIScheme) && 3480 return url->SchemeIs(content::kChromeUIScheme) &&
3466 url->host() == chrome::kChromeUISettingsHost; 3481 url->host() == chrome::kChromeUISettingsHost;
3467 } 3482 }
3468 3483
3469 // static 3484 // static
3470 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3485 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3471 const storage::QuotaSettings* settings) { 3486 const storage::QuotaSettings* settings) {
3472 g_default_quota_settings = settings; 3487 g_default_quota_settings = settings;
3473 } 3488 }
OLDNEW
« 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