OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BLIMP_ENGINE_APP_SETTINGS_MANAGER_H_ | |
6 #define BLIMP_ENGINE_APP_SETTINGS_MANAGER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/observer_list.h" | |
10 #include "blimp/engine/app/engine_settings.h" | |
11 #include "blimp/net/blimp_message_processor.h" | |
12 #include "content/public/browser/render_view_host.h" | |
13 | |
14 namespace blimp { | |
15 namespace engine { | |
16 | |
17 // This class is owned by the BlimpBrowserMainParts and manages the | |
18 // |EngineSettings| that can be set on the engine. | |
19 class SettingsManager { | |
20 public: | |
21 // An observer interested in knowing when the engine settings have changed. | |
22 class Observer { | |
23 public: | |
24 // Called when the WebPreferences have changed. See content::WebPreferences. | |
25 virtual void OnWebPreferencesChanged() {} | |
26 }; | |
27 | |
28 SettingsManager(); | |
29 ~SettingsManager(); | |
30 | |
31 void AddObserver(Observer* observer); | |
32 void RemoveObserver(Observer* observer); | |
33 | |
34 // Called to update the WebPreferences. | |
35 void UpdateWebkitPreferences(content::WebPreferences* prefs); | |
36 | |
37 const EngineSettings& GetEngineSettings() const; | |
38 void UpdateEngineSettings(const EngineSettings& settings); | |
39 | |
40 private: | |
41 EngineSettings settings_; | |
42 | |
43 base::ObserverList<Observer> observer_list_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(SettingsManager); | |
46 }; | |
47 | |
48 } // namespace engine | |
49 } // namespace blimp | |
50 | |
51 #endif // BLIMP_ENGINE_APP_SETTINGS_MANAGER_H_ | |
OLD | NEW |