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

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

Issue 330143002: Simplify geolocation permission request in the Content API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 #include "chrome/browser/download/download_prefs.h" 34 #include "chrome/browser/download/download_prefs.h"
35 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 35 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
36 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" 36 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h"
37 #include "chrome/browser/extensions/extension_renderer_state.h" 37 #include "chrome/browser/extensions/extension_renderer_state.h"
38 #include "chrome/browser/extensions/extension_service.h" 38 #include "chrome/browser/extensions/extension_service.h"
39 #include "chrome/browser/extensions/extension_util.h" 39 #include "chrome/browser/extensions/extension_util.h"
40 #include "chrome/browser/extensions/extension_web_ui.h" 40 #include "chrome/browser/extensions/extension_web_ui.h"
41 #include "chrome/browser/extensions/extension_webkit_preferences.h" 41 #include "chrome/browser/extensions/extension_webkit_preferences.h"
42 #include "chrome/browser/extensions/suggest_permission_util.h" 42 #include "chrome/browser/extensions/suggest_permission_util.h"
43 #include "chrome/browser/geolocation/chrome_access_token_store.h" 43 #include "chrome/browser/geolocation/chrome_access_token_store.h"
44 #include "chrome/browser/geolocation/geolocation_permission_context.h"
45 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
44 #include "chrome/browser/google/google_util.h" 46 #include "chrome/browser/google/google_util.h"
45 #include "chrome/browser/media/cast_transport_host_filter.h" 47 #include "chrome/browser/media/cast_transport_host_filter.h"
46 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 48 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
47 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" 49 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
48 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 50 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
49 #include "chrome/browser/net/chrome_net_log.h" 51 #include "chrome/browser/net/chrome_net_log.h"
50 #include "chrome/browser/notifications/desktop_notification_service.h" 52 #include "chrome/browser/notifications/desktop_notification_service.h"
51 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 53 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
52 #include "chrome/browser/platform_util.h" 54 #include "chrome/browser/platform_util.h"
53 #include "chrome/browser/plugins/plugin_info_message_filter.h" 55 #include "chrome/browser/plugins/plugin_info_message_filter.h"
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext()); 2137 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
2136 DesktopNotificationService* service = 2138 DesktopNotificationService* service =
2137 DesktopNotificationServiceFactory::GetForProfile(profile); 2139 DesktopNotificationServiceFactory::GetForProfile(profile);
2138 service->ShowDesktopNotification( 2140 service->ShowDesktopNotification(
2139 params, render_frame_host, delegate, cancel_callback); 2141 params, render_frame_host, delegate, cancel_callback);
2140 #else 2142 #else
2141 NOTIMPLEMENTED(); 2143 NOTIMPLEMENTED();
2142 #endif 2144 #endif
2143 } 2145 }
2144 2146
2147 void ChromeContentBrowserClient::RequestGeolocationPermission(
2148 content::WebContents* web_contents,
2149 int bridge_id,
2150 const GURL& requesting_frame,
2151 bool user_gesture,
2152 base::Callback<void(bool)> result_callback,
2153 base::Closure* cancel_callback) {
2154 GeolocationPermissionContextFactory::GetForProfile(
2155 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
2156 RequestGeolocationPermission(web_contents, bridge_id,
2157 requesting_frame, user_gesture,
2158 result_callback, cancel_callback);
2159 }
2160
2145 bool ChromeContentBrowserClient::CanCreateWindow( 2161 bool ChromeContentBrowserClient::CanCreateWindow(
2146 const GURL& opener_url, 2162 const GURL& opener_url,
2147 const GURL& opener_top_level_frame_url, 2163 const GURL& opener_top_level_frame_url,
2148 const GURL& source_origin, 2164 const GURL& source_origin,
2149 WindowContainerType container_type, 2165 WindowContainerType container_type,
2150 const GURL& target_url, 2166 const GURL& target_url,
2151 const content::Referrer& referrer, 2167 const content::Referrer& referrer,
2152 WindowOpenDisposition disposition, 2168 WindowOpenDisposition disposition,
2153 const WebWindowFeatures& features, 2169 const WebWindowFeatures& features,
2154 bool user_gesture, 2170 bool user_gesture,
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, 2718 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES,
2703 sandbox::TargetPolicy::HANDLES_DUP_ANY, 2719 sandbox::TargetPolicy::HANDLES_DUP_ANY,
2704 L"File"); 2720 L"File");
2705 if (result != sandbox::SBOX_ALL_OK) { 2721 if (result != sandbox::SBOX_ALL_OK) {
2706 *success = false; 2722 *success = false;
2707 return; 2723 return;
2708 } 2724 }
2709 } 2725 }
2710 #endif 2726 #endif
2711 2727
2728 content::DevToolsManagerDelegate*
2729 ChromeContentBrowserClient::GetDevToolsManagerDelegate() {
2730 return new ChromeDevToolsManagerDelegate();
2731 }
2732
2712 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( 2733 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
2713 content::BrowserContext* browser_context, 2734 content::BrowserContext* browser_context,
2714 const GURL& url) { 2735 const GURL& url) {
2715 #if defined(ENABLE_PLUGINS) 2736 #if defined(ENABLE_PLUGINS)
2716 Profile* profile = Profile::FromBrowserContext(browser_context); 2737 Profile* profile = Profile::FromBrowserContext(browser_context);
2717 const extensions::ExtensionSet* extension_set = NULL; 2738 const extensions::ExtensionSet* extension_set = NULL;
2718 if (profile) { 2739 if (profile) {
2719 extension_set = extensions::ExtensionSystem::Get(profile)-> 2740 extension_set = extensions::ExtensionSystem::Get(profile)->
2720 extension_service()->extensions(); 2741 extension_service()->extensions();
2721 } 2742 }
(...skipping 19 matching lines...) Expand all
2741 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 2762 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2742 // Allow dev channel APIs to be used on "Canary", "Dev", and "Unknown" 2763 // Allow dev channel APIs to be used on "Canary", "Dev", and "Unknown"
2743 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on 2764 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on
2744 // Chromium builds as well. 2765 // Chromium builds as well.
2745 return channel <= chrome::VersionInfo::CHANNEL_DEV; 2766 return channel <= chrome::VersionInfo::CHANNEL_DEV;
2746 #else 2767 #else
2747 return false; 2768 return false;
2748 #endif 2769 #endif
2749 } 2770 }
2750 2771
2751 content::DevToolsManagerDelegate*
2752 ChromeContentBrowserClient::GetDevToolsManagerDelegate() {
2753 return new ChromeDevToolsManagerDelegate();
2754 }
2755
2756 net::CookieStore* 2772 net::CookieStore*
2757 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess( 2773 ChromeContentBrowserClient::OverrideCookieStoreForRenderProcess(
2758 int render_process_id) { 2774 int render_process_id) {
2759 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2775 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2760 if (!prerender_tracker_) 2776 if (!prerender_tracker_)
2761 return NULL; 2777 return NULL;
2762 return prerender_tracker_-> 2778 return prerender_tracker_->
2763 GetPrerenderCookieStoreForRenderProcess(render_process_id); 2779 GetPrerenderCookieStoreForRenderProcess(render_process_id);
2764 } 2780 }
2765 2781
(...skipping 14 matching lines...) Expand all
2780 switches::kDisableWebRtcEncryption, 2796 switches::kDisableWebRtcEncryption,
2781 }; 2797 };
2782 to_command_line->CopySwitchesFrom(from_command_line, 2798 to_command_line->CopySwitchesFrom(from_command_line,
2783 kWebRtcDevSwitchNames, 2799 kWebRtcDevSwitchNames,
2784 arraysize(kWebRtcDevSwitchNames)); 2800 arraysize(kWebRtcDevSwitchNames));
2785 } 2801 }
2786 } 2802 }
2787 #endif // defined(ENABLE_WEBRTC) 2803 #endif // defined(ENABLE_WEBRTC)
2788 2804
2789 } // namespace chrome 2805 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/geolocation/chrome_geolocation_permission_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698