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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return extension->ShouldDisplayInExtensionSettings() && | 71 return extension->ShouldDisplayInExtensionSettings() && |
72 !Manifest::IsPolicyLocation(extension->location()) && | 72 !Manifest::IsPolicyLocation(extension->location()) && |
73 !Manifest::IsComponentLocation(extension->location()) && | 73 !Manifest::IsComponentLocation(extension->location()) && |
74 !CanExecuteScriptEverywhere(extension) && | 74 !CanExecuteScriptEverywhere(extension) && |
75 permissions->ShouldWarnAllHosts(); | 75 permissions->ShouldWarnAllHosts(); |
76 } | 76 } |
77 | 77 |
78 bool PermissionsData::ShouldSkipPermissionWarnings( | 78 bool PermissionsData::ShouldSkipPermissionWarnings( |
79 const std::string& extension_id) { | 79 const std::string& extension_id) { |
80 // See http://b/4946060 for more details. | 80 // See http://b/4946060 for more details. |
81 return extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd"); | 81 return extension_id == extension_misc::kProdHangoutsExtensionId; |
82 } | 82 } |
83 | 83 |
84 // static | 84 // static |
85 bool PermissionsData::IsRestrictedUrl(const GURL& document_url, | 85 bool PermissionsData::IsRestrictedUrl(const GURL& document_url, |
86 const Extension* extension, | 86 const Extension* extension, |
87 std::string* error) { | 87 std::string* error) { |
88 if (extension && CanExecuteScriptEverywhere(extension)) | 88 if (extension && CanExecuteScriptEverywhere(extension)) |
89 return false; | 89 return false; |
90 | 90 |
91 // Check if the scheme is valid for extensions. If not, return. | 91 // Check if the scheme is valid for extensions. If not, return. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 return ACCESS_WITHHELD; | 350 return ACCESS_WITHHELD; |
351 | 351 |
352 if (error) { | 352 if (error) { |
353 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, | 353 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, |
354 document_url.spec()); | 354 document_url.spec()); |
355 } | 355 } |
356 return ACCESS_DENIED; | 356 return ACCESS_DENIED; |
357 } | 357 } |
358 | 358 |
359 } // namespace extensions | 359 } // namespace extensions |
OLD | NEW |