Add API to set render process preferences
This commit is contained in:
parent
b646d7a55c
commit
4fb9e20c33
11 changed files with 347 additions and 0 deletions
35
atom/renderer/preferences_manager.h
Normal file
35
atom/renderer/preferences_manager.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2016 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_RENDERER_PREFERENCES_MANAGER_H_
|
||||
#define ATOM_RENDERER_PREFERENCES_MANAGER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/values.h"
|
||||
#include "content/public/renderer/render_process_observer.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
class PreferencesManager : public content::RenderProcessObserver {
|
||||
public:
|
||||
PreferencesManager();
|
||||
~PreferencesManager() override;
|
||||
|
||||
const base::ListValue* preferences() const { return preferences_.get(); }
|
||||
|
||||
private:
|
||||
// content::RenderThreadObserver:
|
||||
bool OnControlMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
void OnUpdatePreferences(const base::ListValue& preferences);
|
||||
|
||||
std::unique_ptr<base::ListValue> preferences_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PreferencesManager);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_RENDERER_PREFERENCES_MANAGER_H_
|
Loading…
Add table
Add a link
Reference in a new issue