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

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: Rebase 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 if (Manifest::IsUnpackedLocation(extension.location())) { 494 if (Manifest::IsUnpackedLocation(extension.location())) {
495 info->path.reset(new std::string(extension.path().AsUTF8Unsafe())); 495 info->path.reset(new std::string(extension.path().AsUTF8Unsafe()));
496 info->prettified_path.reset(new std::string( 496 info->prettified_path.reset(new std::string(
497 extensions::path_util::PrettifyPath(extension.path()).AsUTF8Unsafe())); 497 extensions::path_util::PrettifyPath(extension.path()).AsUTF8Unsafe()));
498 } 498 }
499 499
500 // Runs on all urls. 500 // Runs on all urls.
501 info->run_on_all_urls.is_enabled = 501 info->run_on_all_urls.is_enabled =
502 (FeatureSwitch::scripts_require_action()->IsEnabled() && 502 (FeatureSwitch::scripts_require_action()->IsEnabled() &&
503 PermissionsData::ScriptsMayRequireActionForExtension( 503 PermissionsData::ScriptsMayRequireActionForExtension(
504 &extension, 504 &extension, extension.permissions_data()->active_permissions())) ||
505 extension.permissions_data()->active_permissions().get())) ||
506 extension.permissions_data()->HasWithheldImpliedAllHosts() || 505 extension.permissions_data()->HasWithheldImpliedAllHosts() ||
507 util::HasSetAllowedScriptingOnAllUrls(extension.id(), browser_context_); 506 util::HasSetAllowedScriptingOnAllUrls(extension.id(), browser_context_);
508 info->run_on_all_urls.is_active = 507 info->run_on_all_urls.is_active =
509 util::AllowedScriptingOnAllUrls(extension.id(), browser_context_); 508 util::AllowedScriptingOnAllUrls(extension.id(), browser_context_);
510 509
511 // Runtime warnings. 510 // Runtime warnings.
512 std::vector<std::string> warnings = 511 std::vector<std::string> warnings =
513 warning_service_->GetWarningMessagesForExtension(extension.id()); 512 warning_service_->GetWarningMessagesForExtension(extension.id());
514 for (const std::string& warning : warnings) 513 for (const std::string& warning : warnings)
515 info->runtime_warnings.push_back(warning); 514 info->runtime_warnings.push_back(warning);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // that at the end of the method, any stored refs are destroyed. 623 // that at the end of the method, any stored refs are destroyed.
625 ExtensionInfoList list; 624 ExtensionInfoList list;
626 list.swap(list_); 625 list.swap(list_);
627 ExtensionInfosCallback callback = callback_; 626 ExtensionInfosCallback callback = callback_;
628 callback_.Reset(); 627 callback_.Reset();
629 callback.Run(list); // WARNING: |this| is possibly deleted after this line! 628 callback.Run(list); // WARNING: |this| is possibly deleted after this line!
630 } 629 }
631 } 630 }
632 631
633 } // namespace extensions 632 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698