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

Side by Side Diff: chrome/browser/content_settings/permission_request_id.cc

Issue 591443002: Componentize permission_request_id.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
(Empty)
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.
4
5 #include "chrome/browser/content_settings/permission_request_id.h"
6
7 #include "base/strings/stringprintf.h"
8
9
10 PermissionRequestID::PermissionRequestID(int render_process_id,
11 int render_view_id,
12 int bridge_id,
13 const GURL& origin)
14 : render_process_id_(render_process_id),
15 render_view_id_(render_view_id),
16 bridge_id_(bridge_id),
17 origin_(origin) {
18 }
19
20 PermissionRequestID::~PermissionRequestID() {
21 }
22
23 bool PermissionRequestID::Equals(const PermissionRequestID& other) const {
24 return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_) &&
25 (origin_ == other.origin());
26 }
27
28 bool PermissionRequestID::IsForSameTabAs(
29 const PermissionRequestID& other) const {
30 return (render_process_id_ == other.render_process_id_) &&
31 (render_view_id_ == other.render_view_id_);
32 }
33
34 std::string PermissionRequestID::ToString() const {
35 return base::StringPrintf("%d,%d,%d,%s",
36 render_process_id_,
37 render_view_id_,
38 bridge_id_,
39 origin_.spec().c_str());
40 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/permission_request_id.h ('k') | chrome/browser/geolocation/geolocation_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698