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

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

Issue 2512123002: Shape Detection: QR detection in Chrome Android using Play Services (Closed)
Patch Set: dcheng@ request to check for |numPixels| overflow Created 4 years 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #include "net/cookies/cookie_options.h" 186 #include "net/cookies/cookie_options.h"
187 #include "net/ssl/ssl_cert_request_info.h" 187 #include "net/ssl/ssl_cert_request_info.h"
188 #include "ppapi/features/features.h" 188 #include "ppapi/features/features.h"
189 #include "ppapi/host/ppapi_host.h" 189 #include "ppapi/host/ppapi_host.h"
190 #include "printing/features/features.h" 190 #include "printing/features/features.h"
191 #include "services/image_decoder/public/interfaces/constants.mojom.h" 191 #include "services/image_decoder/public/interfaces/constants.mojom.h"
192 #include "services/service_manager/public/cpp/interface_provider.h" 192 #include "services/service_manager/public/cpp/interface_provider.h"
193 #include "services/service_manager/public/cpp/interface_registry.h" 193 #include "services/service_manager/public/cpp/interface_registry.h"
194 #include "services/service_manager/public/cpp/service.h" 194 #include "services/service_manager/public/cpp/service.h"
195 #include "storage/browser/fileapi/external_mount_points.h" 195 #include "storage/browser/fileapi/external_mount_points.h"
196 #include "third_party/WebKit/public/platform/modules/shapedetection/barcodedetec tion.mojom.h"
196 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" 197 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h"
197 #include "ui/base/l10n/l10n_util.h" 198 #include "ui/base/l10n/l10n_util.h"
198 #include "ui/base/resource/resource_bundle.h" 199 #include "ui/base/resource/resource_bundle.h"
199 #include "ui/resources/grit/ui_resources.h" 200 #include "ui/resources/grit/ui_resources.h"
200 #include "url/gurl.h" 201 #include "url/gurl.h"
201 #include "url/origin.h" 202 #include "url/origin.h"
202 203
203 #if defined(OS_WIN) 204 #if defined(OS_WIN)
204 #include "base/strings/string_tokenizer.h" 205 #include "base/strings/string_tokenizer.h"
205 #include "chrome/browser/chrome_browser_main_win.h" 206 #include "chrome/browser/chrome_browser_main_win.h"
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 switches::kEnableOfflineAutoReloadVisibleOnly)) { 1434 switches::kEnableOfflineAutoReloadVisibleOnly)) {
1434 return true; 1435 return true;
1435 } 1436 }
1436 if (browser_command_line.HasSwitch( 1437 if (browser_command_line.HasSwitch(
1437 switches::kDisableOfflineAutoReloadVisibleOnly)) { 1438 switches::kDisableOfflineAutoReloadVisibleOnly)) {
1438 return false; 1439 return false;
1439 } 1440 }
1440 return true; 1441 return true;
1441 } 1442 }
1442 1443
1443 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) 1444 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \
1445 defined(OS_ANDROID)
1444 bool AreExperimentalWebPlatformFeaturesEnabled() { 1446 bool AreExperimentalWebPlatformFeaturesEnabled() {
1445 const base::CommandLine& browser_command_line = 1447 const base::CommandLine& browser_command_line =
1446 *base::CommandLine::ForCurrentProcess(); 1448 *base::CommandLine::ForCurrentProcess();
1447 return browser_command_line.HasSwitch( 1449 return browser_command_line.HasSwitch(
1448 switches::kEnableExperimentalWebPlatformFeatures); 1450 switches::kEnableExperimentalWebPlatformFeatures);
1449 } 1451 }
1450 #endif 1452 #endif
1451 1453
1452 void MaybeAppendBlinkSettingsSwitchForFieldTrial( 1454 void MaybeAppendBlinkSettingsSwitchForFieldTrial(
1453 const base::CommandLine& browser_command_line, 1455 const base::CommandLine& browser_command_line,
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3020 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) 3022 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
3021 if (AreExperimentalWebPlatformFeaturesEnabled()) { 3023 if (AreExperimentalWebPlatformFeaturesEnabled()) {
3022 content::WebContents* web_contents = 3024 content::WebContents* web_contents =
3023 content::WebContents::FromRenderFrameHost(render_frame_host); 3025 content::WebContents::FromRenderFrameHost(render_frame_host);
3024 if (web_contents) { 3026 if (web_contents) {
3025 registry->AddInterface( 3027 registry->AddInterface(
3026 base::Bind(CreatePaymentRequestHandler, web_contents)); 3028 base::Bind(CreatePaymentRequestHandler, web_contents));
3027 } 3029 }
3028 } 3030 }
3029 #endif 3031 #endif
3032
3033 #if defined(OS_ANDROID)
3034 if (AreExperimentalWebPlatformFeaturesEnabled()) {
3035 content::WebContents* web_contents =
3036 content::WebContents::FromRenderFrameHost(render_frame_host);
3037 if (web_contents) {
3038 registry->AddInterface(
3039 web_contents->GetJavaInterfaces()
3040 ->CreateInterfaceFactory<blink::mojom::BarcodeDetection>());
3041 }
3042 }
3043 #endif
3044
3030 } 3045 }
3031 3046
3032 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( 3047 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess(
3033 service_manager::InterfaceRegistry* registry, 3048 service_manager::InterfaceRegistry* registry,
3034 content::GpuProcessHost* render_process_host) { 3049 content::GpuProcessHost* render_process_host) {
3035 registry->AddInterface( 3050 registry->AddInterface(
3036 base::Bind(&metrics::CallStackProfileCollector::Create, 3051 base::Bind(&metrics::CallStackProfileCollector::Create,
3037 metrics::CallStackProfileParams::GPU_PROCESS)); 3052 metrics::CallStackProfileParams::GPU_PROCESS));
3038 } 3053 }
3039 3054
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3299 render_frame_host, std::move(source), std::move(request)); 3314 render_frame_host, std::move(source), std::move(request));
3300 #else 3315 #else
3301 // Chrome's media remoting implementation depends on the Media Router 3316 // Chrome's media remoting implementation depends on the Media Router
3302 // infrastructure to identify remote sinks and provide the user interface for 3317 // infrastructure to identify remote sinks and provide the user interface for
3303 // sink selection. In the case where the Media Router is not present, simply 3318 // sink selection. In the case where the Media Router is not present, simply
3304 // drop the interface request. This will prevent code paths for media remoting 3319 // drop the interface request. This will prevent code paths for media remoting
3305 // in the renderer process from activating. 3320 // in the renderer process from activating.
3306 #endif 3321 #endif
3307 } 3322 }
3308 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 3323 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698