atom_api_render_process_preferences.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_
  5. #define ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_
  6. #include "atom/browser/render_process_preferences.h"
  7. #include "native_mate/handle.h"
  8. #include "native_mate/wrappable.h"
  9. namespace atom {
  10. namespace api {
  11. class RenderProcessPreferences
  12. : public mate::Wrappable<RenderProcessPreferences> {
  13. public:
  14. static mate::Handle<RenderProcessPreferences> ForAllWebContents(
  15. v8::Isolate* isolate);
  16. static void BuildPrototype(v8::Isolate* isolate,
  17. v8::Local<v8::FunctionTemplate> prototype);
  18. int AddEntry(const base::DictionaryValue& entry);
  19. void RemoveEntry(int id);
  20. protected:
  21. RenderProcessPreferences(
  22. v8::Isolate* isolate,
  23. const atom::RenderProcessPreferences::Predicate& predicate);
  24. ~RenderProcessPreferences() override;
  25. private:
  26. atom::RenderProcessPreferences preferences_;
  27. DISALLOW_COPY_AND_ASSIGN(RenderProcessPreferences);
  28. };
  29. } // namespace api
  30. } // namespace atom
  31. #endif // ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_