Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / content_settings / permission_request_id.h
blob13d92e3ca1f976049f392c7ce4272a22d03f9b4e
1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
8 #include <string>
10 // Uniquely identifies a particular permission request.
11 class PermissionRequestID {
12 public:
13 PermissionRequestID(int render_process_id,
14 int render_view_id,
15 int bridge_id,
16 int group_id);
17 ~PermissionRequestID();
19 int render_process_id() const { return render_process_id_; }
20 int render_view_id() const { return render_view_id_; }
21 int bridge_id() const { return bridge_id_; }
22 int group_id() const { return group_id_; }
24 bool Equals(const PermissionRequestID& other) const;
25 bool IsForSameTabAs(const PermissionRequestID& other) const;
26 std::string ToString() const;
28 private:
29 int render_process_id_;
30 int render_view_id_;
31 // Id unique to this instance.
32 int bridge_id_;
33 // Id possibly shared by multiple instance. This is used in
34 // PermissionQueueController::CancelInfoBarRequests(int group_id) to cancel
35 // multiple permission requests by a group id.
36 // For example, ProtectedMediaIdentifierPermissionContext class uses this.
37 // If you don't use that function, this doesn't matter and setting this to 0
38 // is recommended.
39 int group_id_;
41 // Purposefully do not disable copying, as this is stored in STL containers.
44 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_