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

Side by Side Diff: chrome/browser/extensions/api/developer_private/extension_info_generator.cc

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/extensions/api/developer_private/extension_info_generat or.h" 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat or.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 if (Manifest::IsUnpackedLocation(extension.location())) { 493 if (Manifest::IsUnpackedLocation(extension.location())) {
494 info->path.reset(new std::string(extension.path().AsUTF8Unsafe())); 494 info->path.reset(new std::string(extension.path().AsUTF8Unsafe()));
495 info->prettified_path.reset(new std::string( 495 info->prettified_path.reset(new std::string(
496 extensions::path_util::PrettifyPath(extension.path()).AsUTF8Unsafe())); 496 extensions::path_util::PrettifyPath(extension.path()).AsUTF8Unsafe()));
497 } 497 }
498 498
499 // Runs on all urls. 499 // Runs on all urls.
500 info->run_on_all_urls.is_enabled = 500 info->run_on_all_urls.is_enabled =
501 (FeatureSwitch::scripts_require_action()->IsEnabled() && 501 (FeatureSwitch::scripts_require_action()->IsEnabled() &&
502 PermissionsData::ScriptsMayRequireActionForExtension( 502 PermissionsData::ScriptsMayRequireActionForExtension(
503 &extension, 503 &extension, extension.permissions_data()->active_permissions())) ||
504 extension.permissions_data()->active_permissions().get())) ||
505 extension.permissions_data()->HasWithheldImpliedAllHosts() || 504 extension.permissions_data()->HasWithheldImpliedAllHosts() ||
506 util::HasSetAllowedScriptingOnAllUrls(extension.id(), browser_context_); 505 util::HasSetAllowedScriptingOnAllUrls(extension.id(), browser_context_);
507 info->run_on_all_urls.is_active = 506 info->run_on_all_urls.is_active =
508 util::AllowedScriptingOnAllUrls(extension.id(), browser_context_); 507 util::AllowedScriptingOnAllUrls(extension.id(), browser_context_);
509 508
510 // Runtime warnings. 509 // Runtime warnings.
511 std::vector<std::string> warnings = 510 std::vector<std::string> warnings =
512 warning_service_->GetWarningMessagesForExtension(extension.id()); 511 warning_service_->GetWarningMessagesForExtension(extension.id());
513 for (const std::string& warning : warnings) 512 for (const std::string& warning : warnings)
514 info->runtime_warnings.push_back(warning); 513 info->runtime_warnings.push_back(warning);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // that at the end of the method, any stored refs are destroyed. 622 // that at the end of the method, any stored refs are destroyed.
624 ExtensionInfoList list; 623 ExtensionInfoList list;
625 list.swap(list_); 624 list.swap(list_);
626 ExtensionInfosCallback callback = callback_; 625 ExtensionInfosCallback callback = callback_;
627 callback_.Reset(); 626 callback_.Reset();
628 callback.Run(list); // WARNING: |this| is possibly deleted after this line! 627 callback.Run(list); // WARNING: |this| is possibly deleted after this line!
629 } 628 }
630 } 629 }
631 630
632 } // namespace extensions 631 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698