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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2446093004: [Web Payments] Initial plumb of Payment Request dialog (Closed)
Patch Set: Handle new member function Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/payments/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/download/download_prefs.h" 50 #include "chrome/browser/download/download_prefs.h"
51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" 51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h"
52 #include "chrome/browser/font_family_cache.h" 52 #include "chrome/browser/font_family_cache.h"
53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" 53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" 54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h"
55 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" 55 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
56 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 56 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
57 #include "chrome/browser/notifications/platform_notification_service_impl.h" 57 #include "chrome/browser/notifications/platform_notification_service_impl.h"
58 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" 58 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h"
59 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 59 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
60 #include "chrome/browser/payments/payment_request_impl.h"
60 #include "chrome/browser/permissions/permission_context_base.h" 61 #include "chrome/browser/permissions/permission_context_base.h"
61 #include "chrome/browser/platform_util.h" 62 #include "chrome/browser/platform_util.h"
62 #include "chrome/browser/prerender/prerender_final_status.h" 63 #include "chrome/browser/prerender/prerender_final_status.h"
63 #include "chrome/browser/prerender/prerender_manager.h" 64 #include "chrome/browser/prerender/prerender_manager.h"
64 #include "chrome/browser/prerender/prerender_manager_factory.h" 65 #include "chrome/browser/prerender/prerender_manager_factory.h"
65 #include "chrome/browser/prerender/prerender_message_filter.h" 66 #include "chrome/browser/prerender/prerender_message_filter.h"
66 #include "chrome/browser/printing/printing_message_filter.h" 67 #include "chrome/browser/printing/printing_message_filter.h"
67 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" 68 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
68 #include "chrome/browser/profiles/profile.h" 69 #include "chrome/browser/profiles/profile.h"
69 #include "chrome/browser/profiles/profile_io_data.h" 70 #include "chrome/browser/profiles/profile_io_data.h"
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 switches::kEnableOfflineAutoReloadVisibleOnly)) { 1431 switches::kEnableOfflineAutoReloadVisibleOnly)) {
1431 return true; 1432 return true;
1432 } 1433 }
1433 if (browser_command_line.HasSwitch( 1434 if (browser_command_line.HasSwitch(
1434 switches::kDisableOfflineAutoReloadVisibleOnly)) { 1435 switches::kDisableOfflineAutoReloadVisibleOnly)) {
1435 return false; 1436 return false;
1436 } 1437 }
1437 return true; 1438 return true;
1438 } 1439 }
1439 1440
1441 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
1442 bool AreExperimentalWebPlatformFeaturesEnabled() {
1443 const base::CommandLine& browser_command_line =
1444 *base::CommandLine::ForCurrentProcess();
1445 return browser_command_line.HasSwitch(
1446 switches::kEnableExperimentalWebPlatformFeatures);
1447 }
1448 #endif
1449
1440 void MaybeAppendBlinkSettingsSwitchForFieldTrial( 1450 void MaybeAppendBlinkSettingsSwitchForFieldTrial(
1441 const base::CommandLine& browser_command_line, 1451 const base::CommandLine& browser_command_line,
1442 base::CommandLine* command_line) { 1452 base::CommandLine* command_line) {
1443 // List of field trials that modify the blink-settings command line flag. No 1453 // List of field trials that modify the blink-settings command line flag. No
1444 // two field trials in the list should specify the same keys, otherwise one 1454 // two field trials in the list should specify the same keys, otherwise one
1445 // field trial may overwrite another. See Source/core/frame/Settings.in in 1455 // field trial may overwrite another. See Source/core/frame/Settings.in in
1446 // Blink for the list of valid keys. 1456 // Blink for the list of valid keys.
1447 static const char* const kBlinkSettingsFieldTrials[] = { 1457 static const char* const kBlinkSettingsFieldTrials[] = {
1448 // Keys: backgroundHtmlParserOutstandingTokenLimit 1458 // Keys: backgroundHtmlParserOutstandingTokenLimit
1449 // backgroundHtmlParserPendingTokenLimit 1459 // backgroundHtmlParserPendingTokenLimit
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 content::WebContents* web_contents = 3007 content::WebContents* web_contents =
2998 content::WebContents::FromRenderFrameHost(render_frame_host); 3008 content::WebContents::FromRenderFrameHost(render_frame_host);
2999 if (web_contents) { 3009 if (web_contents) {
3000 registry->AddInterface( 3010 registry->AddInterface(
3001 web_contents->GetJavaInterfaces() 3011 web_contents->GetJavaInterfaces()
3002 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); 3012 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>());
3003 registry->AddInterface( 3013 registry->AddInterface(
3004 base::Bind(&ForwardShareServiceRequest, 3014 base::Bind(&ForwardShareServiceRequest,
3005 web_contents->GetJavaInterfaces()->GetWeakPtr())); 3015 web_contents->GetJavaInterfaces()->GetWeakPtr()));
3006 } 3016 }
3017 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
3018 if (AreExperimentalWebPlatformFeaturesEnabled()) {
3019 content::WebContents* web_contents =
3020 content::WebContents::FromRenderFrameHost(render_frame_host);
3021 if (web_contents) {
3022 registry->AddInterface(
3023 base::Bind(CreatePaymentRequestHandler, web_contents));
3024 }
3025 }
3007 #endif 3026 #endif
3008 } 3027 }
3009 3028
3010 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( 3029 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess(
3011 service_manager::InterfaceRegistry* registry, 3030 service_manager::InterfaceRegistry* registry,
3012 content::GpuProcessHost* render_process_host) { 3031 content::GpuProcessHost* render_process_host) {
3013 registry->AddInterface( 3032 registry->AddInterface(
3014 base::Bind(&metrics::CallStackProfileCollector::Create, 3033 base::Bind(&metrics::CallStackProfileCollector::Create,
3015 metrics::CallStackProfileParams::GPU_PROCESS)); 3034 metrics::CallStackProfileParams::GPU_PROCESS));
3016 } 3035 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
3277 render_frame_host, std::move(source), std::move(request)); 3296 render_frame_host, std::move(source), std::move(request));
3278 #else 3297 #else
3279 // Chrome's media remoting implementation depends on the Media Router 3298 // Chrome's media remoting implementation depends on the Media Router
3280 // infrastructure to identify remote sinks and provide the user interface for 3299 // infrastructure to identify remote sinks and provide the user interface for
3281 // sink selection. In the case where the Media Router is not present, simply 3300 // sink selection. In the case where the Media Router is not present, simply
3282 // drop the interface request. This will prevent code paths for media remoting 3301 // drop the interface request. This will prevent code paths for media remoting
3283 // in the renderer process from activating. 3302 // in the renderer process from activating.
3284 #endif 3303 #endif
3285 } 3304 }
3286 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 3305 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/payments/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698