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

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

Issue 750633003: Implement HasPermission() method in PermissionService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments, switched to use BrowserContext, passing PermissionStatus in callback Created 6 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 #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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/memory/linked_ptr.h" 14 #include "base/memory/linked_ptr.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "content/public/browser/certificate_request_result_type.h" 18 #include "content/public/browser/certificate_request_result_type.h"
19 #include "content/public/browser/desktop_notification_delegate.h" 19 #include "content/public/browser/desktop_notification_delegate.h"
20 #include "content/public/browser/permission_type.h" 20 #include "content/public/browser/permission_type.h"
21 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
22 #include "content/public/common/media_stream_request.h" 22 #include "content/public/common/media_stream_request.h"
23 #include "content/public/common/permission_status.mojom.h"
23 #include "content/public/common/resource_type.h" 24 #include "content/public/common/resource_type.h"
24 #include "content/public/common/socket_permission_request.h" 25 #include "content/public/common/socket_permission_request.h"
25 #include "content/public/common/window_container_type.h" 26 #include "content/public/common/window_container_type.h"
26 #include "net/base/mime_util.h" 27 #include "net/base/mime_util.h"
27 #include "net/cookies/canonical_cookie.h" 28 #include "net/cookies/canonical_cookie.h"
28 #include "net/url_request/url_request_interceptor.h" 29 #include "net/url_request/url_request_interceptor.h"
29 #include "net/url_request/url_request_job_factory.h" 30 #include "net/url_request/url_request_job_factory.h"
30 #include "storage/browser/fileapi/file_system_context.h" 31 #include "storage/browser/fileapi/file_system_context.h"
31 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" 32 #include "third_party/WebKit/public/platform/WebNotificationPermission.h"
32 #include "ui/base/window_open_disposition.h" 33 #include "ui/base/window_open_disposition.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 class SiteInstance; 103 class SiteInstance;
103 class SpeechRecognitionManagerDelegate; 104 class SpeechRecognitionManagerDelegate;
104 class VibrationProvider; 105 class VibrationProvider;
105 class WebContents; 106 class WebContents;
106 class WebContentsViewDelegate; 107 class WebContentsViewDelegate;
107 struct MainFunctionParams; 108 struct MainFunctionParams;
108 struct Referrer; 109 struct Referrer;
109 struct ShowDesktopNotificationHostMsgParams; 110 struct ShowDesktopNotificationHostMsgParams;
110 struct WebPreferences; 111 struct WebPreferences;
111 112
113 typedef base::Callback<void(PermissionStatus)> PermissionStatusCallback;
114
112 // A mapping from the scheme name to the protocol handler that services its 115 // A mapping from the scheme name to the protocol handler that services its
113 // content. 116 // content.
114 typedef std::map< 117 typedef std::map<
115 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > 118 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> >
116 ProtocolHandlerMap; 119 ProtocolHandlerMap;
117 120
118 // A scoped vector of protocol interceptors. 121 // A scoped vector of protocol interceptors.
119 typedef ScopedVector<net::URLRequestInterceptor> 122 typedef ScopedVector<net::URLRequestInterceptor>
120 URLRequestInterceptorScopedVector; 123 URLRequestInterceptorScopedVector;
121 124
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 448
446 virtual void CancelPermissionRequest(PermissionType permission, 449 virtual void CancelPermissionRequest(PermissionType permission,
447 WebContents* web_contents, 450 WebContents* web_contents,
448 int bridge_id, 451 int bridge_id,
449 const GURL& requesting_frame) {} 452 const GURL& requesting_frame) {}
450 453
451 virtual void RegisterPermissionUsage(PermissionType permission, 454 virtual void RegisterPermissionUsage(PermissionType permission,
452 WebContents* web_contents, 455 WebContents* web_contents,
453 const GURL& frame_url, 456 const GURL& frame_url,
454 const GURL& main_frame_url) {} 457 const GURL& main_frame_url) {}
458 virtual void HasPermission(
mlamouri (slow - plz ping) 2014/11/24 19:06:01 nit: could you rename this GetPermissionStatus()?
timvolodine 2014/11/27 17:53:42 Done.
459 PermissionType permission,
460 BrowserContext* browser_context,
461 const GURL& requesting_origin,
462 const GURL& embedding_origin,
463 const PermissionStatusCallback& result_callback);
455 464
456 // Returns true if the given page is allowed to open a window of the given 465 // Returns true if the given page is allowed to open a window of the given
457 // type. If true is returned, |no_javascript_access| will indicate whether 466 // type. If true is returned, |no_javascript_access| will indicate whether
458 // the window that is created should be scriptable/in the same process. 467 // the window that is created should be scriptable/in the same process.
459 // This is called on the IO thread. 468 // This is called on the IO thread.
460 virtual bool CanCreateWindow(const GURL& opener_url, 469 virtual bool CanCreateWindow(const GURL& opener_url,
461 const GURL& opener_top_level_frame_url, 470 const GURL& opener_top_level_frame_url,
462 const GURL& source_origin, 471 const GURL& source_origin,
463 WindowContainerType container_type, 472 WindowContainerType container_type,
464 const GURL& target_url, 473 const GURL& target_url,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // camera. Note that this does not query the user. |type| must be 632 // camera. Note that this does not query the user. |type| must be
624 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. 633 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE.
625 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context, 634 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context,
626 const GURL& security_origin, 635 const GURL& security_origin,
627 MediaStreamType type); 636 MediaStreamType type);
628 }; 637 };
629 638
630 } // namespace content 639 } // namespace content
631 640
632 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 641 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698