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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2104193002: Geolocation: Extract GeolocationProvider::Delegate into GeolocationDelegate (no new code) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: jam@ nit: content/browser/geolocation/geolocation_delegate.cc --> content/public/browser Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 23 matching lines...) Expand all
34 #include "chromecast/common/global_descriptors.h" 34 #include "chromecast/common/global_descriptors.h"
35 #include "chromecast/media/audio/cast_audio_manager.h" 35 #include "chromecast/media/audio/cast_audio_manager.h"
36 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" 36 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h"
37 #include "chromecast/public/media/media_pipeline_backend.h" 37 #include "chromecast/public/media/media_pipeline_backend.h"
38 #include "components/crash/content/app/breakpad_linux.h" 38 #include "components/crash/content/app/breakpad_linux.h"
39 #include "components/crash/content/browser/crash_handler_host_linux.h" 39 #include "components/crash/content/browser/crash_handler_host_linux.h"
40 #include "components/network_hints/browser/network_hints_message_filter.h" 40 #include "components/network_hints/browser/network_hints_message_filter.h"
41 #include "content/public/browser/browser_thread.h" 41 #include "content/public/browser/browser_thread.h"
42 #include "content/public/browser/certificate_request_result_type.h" 42 #include "content/public/browser/certificate_request_result_type.h"
43 #include "content/public/browser/client_certificate_delegate.h" 43 #include "content/public/browser/client_certificate_delegate.h"
44 #include "content/public/browser/geolocation_delegate.h"
44 #include "content/public/browser/render_process_host.h" 45 #include "content/public/browser/render_process_host.h"
45 #include "content/public/browser/resource_dispatcher_host.h" 46 #include "content/public/browser/resource_dispatcher_host.h"
46 #include "content/public/browser/web_contents.h" 47 #include "content/public/browser/web_contents.h"
47 #include "content/public/common/content_descriptors.h" 48 #include "content/public/common/content_descriptors.h"
48 #include "content/public/common/content_switches.h" 49 #include "content/public/common/content_switches.h"
49 #include "content/public/common/url_constants.h" 50 #include "content/public/common/url_constants.h"
50 #include "content/public/common/web_preferences.h" 51 #include "content/public/common/web_preferences.h"
51 #include "net/ssl/ssl_cert_request_info.h" 52 #include "net/ssl/ssl_cert_request_info.h"
52 #include "net/url_request/url_request_context_getter.h" 53 #include "net/url_request/url_request_context_getter.h"
53 #include "ui/gl/gl_switches.h" 54 #include "ui/gl/gl_switches.h"
(...skipping 24 matching lines...) Expand all
78 base::Unretained(browser_client)), 79 base::Unretained(browser_client)),
79 base::Bind(&CastContentBrowserClient::CreateCdmFactory, 80 base::Bind(&CastContentBrowserClient::CreateCdmFactory,
80 base::Unretained(browser_client)))); 81 base::Unretained(browser_client))));
81 return std::unique_ptr<::shell::ShellClient>( 82 return std::unique_ptr<::shell::ShellClient>(
82 new ::media::MojoMediaApplication(std::move(mojo_media_client), 83 new ::media::MojoMediaApplication(std::move(mojo_media_client),
83 quit_closure)); 84 quit_closure));
84 } 85 }
85 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 86 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
86 87
87 // A provider of services for Geolocation. 88 // A provider of services for Geolocation.
88 class CastGeolocationDelegate : public content::GeolocationProvider::Delegate { 89 class CastGeolocationDelegate : public content::GeolocationDelegate {
89 public: 90 public:
90 explicit CastGeolocationDelegate(CastBrowserContext* context) 91 explicit CastGeolocationDelegate(CastBrowserContext* context)
91 : context_(context) {} 92 : context_(context) {}
92 content::AccessTokenStore* CreateAccessTokenStore() override { 93 content::AccessTokenStore* CreateAccessTokenStore() override {
93 return new CastAccessTokenStore(context_); 94 return new CastAccessTokenStore(context_);
94 } 95 }
95 96
96 private: 97 private:
97 CastBrowserContext* context_; 98 CastBrowserContext* context_;
98 99
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // GLES2 contexts can be lost to a power-save mode, which breaks GPU canvas 270 // GLES2 contexts can be lost to a power-save mode, which breaks GPU canvas
270 // apps. 271 // apps.
271 if (process_type == switches::kGpuProcess) { 272 if (process_type == switches::kGpuProcess) {
272 command_line->AppendSwitch(switches::kGpuNoContextLost); 273 command_line->AppendSwitch(switches::kGpuNoContextLost);
273 } 274 }
274 #endif 275 #endif
275 276
276 AppendExtraCommandLineSwitches(command_line); 277 AppendExtraCommandLineSwitches(command_line);
277 } 278 }
278 279
279 content::GeolocationProvider::Delegate* 280 content::GeolocationDelegate*
280 CastContentBrowserClient::CreateGeolocationDelegate() { 281 CastContentBrowserClient::CreateGeolocationDelegate() {
281 return new CastGeolocationDelegate( 282 return new CastGeolocationDelegate(
282 CastBrowserProcess::GetInstance()->browser_context()); 283 CastBrowserProcess::GetInstance()->browser_context());
283 } 284 }
284 285
285 void CastContentBrowserClient::OverrideWebkitPrefs( 286 void CastContentBrowserClient::OverrideWebkitPrefs(
286 content::RenderViewHost* render_view_host, 287 content::RenderViewHost* render_view_host,
287 content::WebPreferences* prefs) { 288 content::WebPreferences* prefs) {
288 prefs->allow_scripts_to_close_windows = true; 289 prefs->allow_scripts_to_close_windows = true;
289 // TODO(lcwu): http://crbug.com/391089. This pref is set to true by default 290 // TODO(lcwu): http://crbug.com/391089. This pref is set to true by default
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 process_type, dumps_path, false /* upload */); 535 process_type, dumps_path, false /* upload */);
535 // StartUploaderThread() even though upload is diferred. 536 // StartUploaderThread() even though upload is diferred.
536 // Breakpad-related memory is freed in the uploader thread. 537 // Breakpad-related memory is freed in the uploader thread.
537 crash_handler->StartUploaderThread(); 538 crash_handler->StartUploaderThread();
538 return crash_handler; 539 return crash_handler;
539 } 540 }
540 #endif // !defined(OS_ANDROID) 541 #endif // !defined(OS_ANDROID)
541 542
542 } // namespace shell 543 } // namespace shell
543 } // namespace chromecast 544 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | content/browser/geolocation/geolocation_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698