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

Side by Side Diff: content/public/browser/content_browser_client.h

Issue 571483002: Refactor content client to include a single Request/CancelPermission method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geoloc_permission
Patch Set: Created 6 years, 3 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 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 class SiteInstance; 102 class SiteInstance;
103 class SpeechRecognitionManagerDelegate; 103 class SpeechRecognitionManagerDelegate;
104 class VibrationProvider; 104 class VibrationProvider;
105 class WebContents; 105 class WebContents;
106 class WebContentsViewDelegate; 106 class WebContentsViewDelegate;
107 struct MainFunctionParams; 107 struct MainFunctionParams;
108 struct Referrer; 108 struct Referrer;
109 struct ShowDesktopNotificationHostMsgParams; 109 struct ShowDesktopNotificationHostMsgParams;
110 struct WebPreferences; 110 struct WebPreferences;
111 111
112
113 enum PermissionType {
114 PERMISSION_UNKNOWN = 0,
115 PERMISSION_MIDI_SYSEX = 1,
116 PERMISSION_PUSH_MESSAGING = 2,
117 PERMISSION_NOTIFICATIONS = 3,
118 PERMISSION_GEOLOCATION = 4,
119 PERMISSION_PROTECTED_MEDIA = 5,
120
121 // Always keep this at the end.
122 PERMISSION_NUM,
123 };
124
112 // A mapping from the scheme name to the protocol handler that services its 125 // A mapping from the scheme name to the protocol handler that services its
113 // content. 126 // content.
114 typedef std::map< 127 typedef std::map<
115 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > 128 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> >
116 ProtocolHandlerMap; 129 ProtocolHandlerMap;
117 130
118 // A scoped vector of protocol interceptors. 131 // A scoped vector of protocol interceptors.
119 typedef ScopedVector<net::URLRequestInterceptor> 132 typedef ScopedVector<net::URLRequestInterceptor>
120 URLRequestInterceptorScopedVector; 133 URLRequestInterceptorScopedVector;
121 134
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 int render_process_id); 441 int render_process_id);
429 442
430 // Show a desktop notification. If |cancel_callback| is non-null, it's set to 443 // Show a desktop notification. If |cancel_callback| is non-null, it's set to
431 // a callback which can be used to cancel the notification. 444 // a callback which can be used to cancel the notification.
432 virtual void ShowDesktopNotification( 445 virtual void ShowDesktopNotification(
433 const ShowDesktopNotificationHostMsgParams& params, 446 const ShowDesktopNotificationHostMsgParams& params,
434 RenderFrameHost* render_frame_host, 447 RenderFrameHost* render_frame_host,
435 scoped_ptr<DesktopNotificationDelegate> delegate, 448 scoped_ptr<DesktopNotificationDelegate> delegate,
436 base::Closure* cancel_callback) {} 449 base::Closure* cancel_callback) {}
437 450
438 // The renderer is requesting permission to use Geolocation. When the answer 451 virtual void RequestPermission(
439 // to a permission request has been determined, |result_callback| should be 452 PermissionType permission,
440 // called with the result. If |cancel_callback| is non-null, it's set to a
441 // callback which can be used to cancel the permission request.
442 virtual void RequestGeolocationPermission(
443 WebContents* web_contents, 453 WebContents* web_contents,
444 int bridge_id, 454 int bridge_id,
445 const GURL& requesting_frame, 455 const GURL& requesting_frame,
446 bool user_gesture, 456 bool user_gesture,
447 const base::Callback<void(bool)>& result_callback); 457 const base::Callback<void(bool)>& result_callback);
448 458
449 virtual void CancelGeolocationPermissionRequest( 459
460 virtual void CancelPermissionRequest(
461 PermissionType permission,
450 WebContents* web_contents, 462 WebContents* web_contents,
451 int bridge_id, 463 int bridge_id,
452 const GURL& requesting_frame); 464 const GURL& requesting_frame);
453 465
454 // Invoked when the Geolocation API uses its permission. 466 // Invoked when the Geolocation API uses its permission.
455 virtual void DidUseGeolocationPermission(WebContents* web_contents, 467 virtual void DidUseGeolocationPermission(WebContents* web_contents,
456 const GURL& frame_url, 468 const GURL& frame_url,
457 const GURL& main_frame_url) {} 469 const GURL& main_frame_url) {}
458 470
459 // Requests a permission to use system exclusive messages in MIDI events.
460 // |result_callback| will be invoked when the request is resolved. If
461 // |cancel_callback| is non-null, it's set to a callback which can be used to
462 // cancel the permission request.
463 virtual void RequestMidiSysExPermission(
464 WebContents* web_contents,
465 int bridge_id,
466 const GURL& requesting_frame,
467 bool user_gesture,
468 base::Callback<void(bool)> result_callback,
469 base::Closure* cancel_callback);
470
471 // Request permission to access protected media identifier. |result_callback
472 // will tell whether it's permitted. If |cancel_callback| is non-null, it's
473 // set to a callback which can be used to cancel the permission request.
474 virtual void RequestProtectedMediaIdentifierPermission(
475 WebContents* web_contents,
476 const GURL& origin,
477 base::Callback<void(bool)> result_callback,
478 base::Closure* cancel_callback);
479 471
480 // Returns true if the given page is allowed to open a window of the given 472 // Returns true if the given page is allowed to open a window of the given
481 // type. If true is returned, |no_javascript_access| will indicate whether 473 // type. If true is returned, |no_javascript_access| will indicate whether
482 // the window that is created should be scriptable/in the same process. 474 // the window that is created should be scriptable/in the same process.
483 // This is called on the IO thread. 475 // This is called on the IO thread.
484 virtual bool CanCreateWindow(const GURL& opener_url, 476 virtual bool CanCreateWindow(const GURL& opener_url,
485 const GURL& opener_top_level_frame_url, 477 const GURL& opener_top_level_frame_url,
486 const GURL& source_origin, 478 const GURL& source_origin,
487 WindowContainerType container_type, 479 WindowContainerType container_type,
488 const GURL& target_url, 480 const GURL& target_url,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 // camera. Note that this does not query the user. |type| must be 639 // camera. Note that this does not query the user. |type| must be
648 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. 640 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE.
649 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context, 641 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context,
650 const GURL& security_origin, 642 const GURL& security_origin,
651 MediaStreamType type); 643 MediaStreamType type);
652 }; 644 };
653 645
654 } // namespace content 646 } // namespace content
655 647
656 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 648 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW
« no previous file with comments | « content/browser/media/midi_dispatcher_host.cc ('k') | content/public/browser/content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698