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

Side by Side Diff: chrome/browser/permissions/permission_bubble_request_impl.h

Issue 2123653006: Rename PermissionBubbleRequest to PermissionRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_manager_rename
Patch Set: Fix missed file 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
(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 CHROME_BROWSER_PERMISSIONS_PERMISSION_BUBBLE_REQUEST_IMPL_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_BUBBLE_REQUEST_IMPL_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "chrome/browser/permissions/permission_request_id.h"
11 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
12 #include "components/content_settings/core/common/content_settings.h"
13 #include "content/public/browser/permission_type.h"
14
15 class GURL;
16 class PermissionContextBase;
17
18 // Default implementation of PermissionBubbleRequest, it is assumed that the
19 // caller owns it and that it can be deleted once the |delete_callback|
20 // is executed.
21 class PermissionBubbleRequestImpl : public PermissionBubbleRequest {
22 public:
23 using PermissionDecidedCallback = base::Callback<void(bool, ContentSetting)>;
24
25 PermissionBubbleRequestImpl(
26 const GURL& request_origin,
27 content::PermissionType permission_type,
28 const PermissionDecidedCallback& permission_decided_callback,
29 const base::Closure delete_callback);
30
31 ~PermissionBubbleRequestImpl() override;
32
33 protected:
34 void RegisterActionTaken() { action_taken_ = true; }
35
36 private:
37 // PermissionBubbleRequest:
38 gfx::VectorIconId GetVectorIconId() const override;
39 int GetIconId() const override;
40 base::string16 GetMessageTextFragment() const override;
41 GURL GetOrigin() const override;
42 // Remember to call RegisterActionTaken for these methods if you are
43 // overriding them.
44 void PermissionGranted() override;
45 void PermissionDenied() override;
46 void Cancelled() override;
47 void RequestFinished() override;
48 PermissionBubbleType GetPermissionBubbleType() const override;
49
50 GURL request_origin_;
51 content::PermissionType permission_type_;
52
53 // Called once a decision is made about the permission.
54 const PermissionDecidedCallback permission_decided_callback_;
55
56 // Called when the bubble is no longer in use so it can be deleted by
57 // the caller.
58 const base::Closure delete_callback_;
59 bool is_finished_;
60 bool action_taken_;
61
62 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleRequestImpl);
63 };
64
65 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_BUBBLE_REQUEST_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/permissions/mock_permission_request.cc ('k') | chrome/browser/permissions/permission_bubble_request_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698