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

Side by Side Diff: content/browser/permissions/permission_service_context.h

Issue 722153003: Implement basic mojo Permission service and use it for Geolocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_
6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_vector.h"
10 #include "content/public/browser/web_contents_observer.h"
11 #include "mojo/public/cpp/bindings/interface_request.h"
12
13 namespace content {
14
15 class PermissionService;
16 class PermissionServiceImpl;
17 class RenderFrameHost;
18
19 // Provides information to a PermissionService. It is used by the
20 // PermissionService to handle request permission UI.
21 // The RenderFrameHost creates an instance when setting up the Permission mojo
blundell 2014/11/14 14:41:59 This comment is out-of-date.
mlamouri (slow - plz ping) 2014/11/14 16:14:45 Acknowledged.
22 // service and then passes ownership to the service.
23 class PermissionServiceContext : public WebContentsObserver {
24 public:
25 void CreateService(mojo::InterfaceRequest<PermissionService> request);
26
27 // Called by a PermissionService identified as |service| when it has a
28 // connection error in order to get unregistered and killed.
29 void ServiceHadConnectionError(PermissionServiceImpl* service);
30
31 public:
32 explicit PermissionServiceContext(RenderFrameHost* render_frame_host);
blundell 2014/11/14 14:41:59 these should be at the top, and you can kill the d
mlamouri (slow - plz ping) 2014/11/14 16:14:45 Oups :)
33 virtual ~PermissionServiceContext();
34
35 // WebContentsObserver
36 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
blundell 2014/11/14 14:41:59 nit: I would make these private to make it clear t
mlamouri (slow - plz ping) 2014/11/14 16:14:45 Done.
37 void DidNavigateAnyFrame(RenderFrameHost* render_frame_host,
38 const LoadCommittedDetails& details,
39 const FrameNavigateParams& params) override;
40
41 private:
42 void CancelPendingRequests(RenderFrameHost*) const;
43
44 RenderFrameHost* render_frame_host_;
45 ScopedVector<PermissionServiceImpl> services_;
46
47 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698