// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_COMMON_EXTENSION_BUILDER_H_ #define EXTENSIONS_COMMON_EXTENSION_BUILDER_H_ #include <initializer_list> #include <memory> #include <optional> #include <string> #include <string_view> #include <utility> #include "base/files/file_path.h" #include "base/memory/scoped_refptr.h" #include "base/values.h" #include "extensions/common/api/extension_action/action_info.h" #include "extensions/common/manifest.h" #include "extensions/common/mojom/manifest.mojom-shared.h" namespace extensions { class Extension; // An easier way to create extensions than Extension::Create. The // constructor sets up some defaults which are customized using the // methods. // This class can be used in two ways: // Aided Manifest Construction // The easy way. Use the constructor that takes a name and use helper methods // like AddPermission() to customize the extension without needing to // construct the manifest dictionary by hand. For more customization, you can // use MergeManifest() to add additional keys (which will take precedence over // others). // Custom Manifest Construction // The hard way. Use the default constructor. SetManifest() *must* be called // with a valid manifest dictionary. // TODO(devlin): My suspicion is that this is almost always less readable and // useful, but it came first and is used in many places. It'd be nice to maybe // get rid of it. // These are not interchangable - calling SetManifest() with aided manifest // construction or e.g. AddPermissions() with custom manifest construction will // crash. class ExtensionBuilder { … }; } // namespace extensions #endif // EXTENSIONS_COMMON_EXTENSION_BUILDER_H_