| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/permissions/permissions_data.h" | 5 #include "extensions/common/permissions/permissions_data.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/common/url_constants.h" | 8 #include "content/public/common/url_constants.h" |
| 9 #include "extensions/common/constants.h" | 9 #include "extensions/common/constants.h" |
| 10 #include "extensions/common/error_utils.h" | 10 #include "extensions/common/error_utils.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 PermissionMessageStrings PermissionsData::GetPermissionMessageStrings() const { | 207 PermissionMessageStrings PermissionsData::GetPermissionMessageStrings() const { |
| 208 if (ShouldSkipPermissionWarnings(extension_id_)) | 208 if (ShouldSkipPermissionWarnings(extension_id_)) |
| 209 return PermissionMessageStrings(); | 209 return PermissionMessageStrings(); |
| 210 return PermissionMessageProvider::Get()->GetPermissionMessageStrings( | 210 return PermissionMessageProvider::Get()->GetPermissionMessageStrings( |
| 211 active_permissions().get(), manifest_type_); | 211 active_permissions().get(), manifest_type_); |
| 212 } | 212 } |
| 213 | 213 |
| 214 std::vector<base::string16> PermissionsData::GetLegacyPermissionMessageStrings() | |
| 215 const { | |
| 216 if (ShouldSkipPermissionWarnings(extension_id_)) | |
| 217 return std::vector<base::string16>(); | |
| 218 return PermissionMessageProvider::Get()->GetLegacyWarningMessages( | |
| 219 active_permissions().get(), manifest_type_); | |
| 220 } | |
| 221 | |
| 222 std::vector<base::string16> | |
| 223 PermissionsData::GetLegacyPermissionMessageDetailsStrings() const { | |
| 224 if (ShouldSkipPermissionWarnings(extension_id_)) | |
| 225 return std::vector<base::string16>(); | |
| 226 return PermissionMessageProvider::Get()->GetLegacyWarningMessagesDetails( | |
| 227 active_permissions().get(), manifest_type_); | |
| 228 } | |
| 229 | |
| 230 CoalescedPermissionMessages PermissionsData::GetCoalescedPermissionMessages() | 214 CoalescedPermissionMessages PermissionsData::GetCoalescedPermissionMessages() |
| 231 const { | 215 const { |
| 232 return PermissionMessageProvider::Get()->GetCoalescedPermissionMessages( | 216 return PermissionMessageProvider::Get()->GetCoalescedPermissionMessages( |
| 233 PermissionMessageProvider::Get()->GetAllPermissionIDs( | 217 PermissionMessageProvider::Get()->GetAllPermissionIDs( |
| 234 active_permissions().get(), manifest_type_)); | 218 active_permissions().get(), manifest_type_)); |
| 235 } | 219 } |
| 236 | 220 |
| 237 bool PermissionsData::HasWithheldImpliedAllHosts() const { | 221 bool PermissionsData::HasWithheldImpliedAllHosts() const { |
| 238 // Since we currently only withhold all_hosts, it's sufficient to check | 222 // Since we currently only withhold all_hosts, it's sufficient to check |
| 239 // that either set is not empty. | 223 // that either set is not empty. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 return ACCESS_WITHHELD; | 371 return ACCESS_WITHHELD; |
| 388 | 372 |
| 389 if (error) { | 373 if (error) { |
| 390 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, | 374 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, |
| 391 document_url.spec()); | 375 document_url.spec()); |
| 392 } | 376 } |
| 393 return ACCESS_DENIED; | 377 return ACCESS_DENIED; |
| 394 } | 378 } |
| 395 | 379 |
| 396 } // namespace extensions | 380 } // namespace extensions |
| OLD | NEW |