OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/geolocation/geolocation_permission_request_id.h" |
| 6 |
| 7 #include "base/stringprintf.h" |
| 8 |
| 9 |
| 10 GeolocationPermissionRequestID::GeolocationPermissionRequestID( |
| 11 int render_process_id, |
| 12 int render_view_id, |
| 13 int bridge_id) |
| 14 : render_process_id_(render_process_id), |
| 15 render_view_id_(render_view_id), |
| 16 bridge_id_(bridge_id) { |
| 17 } |
| 18 |
| 19 GeolocationPermissionRequestID::~GeolocationPermissionRequestID() { |
| 20 } |
| 21 |
| 22 bool GeolocationPermissionRequestID::Equals( |
| 23 const GeolocationPermissionRequestID& other) const { |
| 24 return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_); |
| 25 } |
| 26 |
| 27 bool GeolocationPermissionRequestID::IsForSameTabAs( |
| 28 const GeolocationPermissionRequestID& other) const { |
| 29 return (render_process_id_ == other.render_process_id_) && |
| 30 (render_view_id_ == other.render_view_id_); |
| 31 } |
| 32 |
| 33 std::string GeolocationPermissionRequestID::ToString() const { |
| 34 return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_, |
| 35 bridge_id_); |
| 36 } |
OLD | NEW |