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

Side by Side Diff: blimp/engine/app/settings_manager.cc

Issue 2629743003: Remove all blimp engine code (Closed)
Patch Set: Use consistent comment style in //chrome Created 3 years, 11 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
« no previous file with comments | « blimp/engine/app/settings_manager.h ('k') | blimp/engine/app/settings_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include <blimp/engine/app/settings_manager.h>
6 #include "content/public/browser/render_view_host.h"
7 #include "content/public/common/web_preferences.h"
8
9 namespace blimp {
10 namespace engine {
11
12 SettingsManager::SettingsManager() {}
13
14 SettingsManager::~SettingsManager() {}
15
16 void SettingsManager::AddObserver(Observer* observer) {
17 observer_list_.AddObserver(observer);
18 }
19
20 void SettingsManager::RemoveObserver(Observer* observer) {
21 observer_list_.RemoveObserver(observer);
22 }
23
24 void SettingsManager::UpdateWebkitPreferences(content::WebPreferences* prefs) {
25 prefs->record_whole_document = settings_.record_whole_document;
26 prefs->animation_policy = settings_.animation_policy;
27 prefs->viewport_meta_enabled = settings_.viewport_meta_enabled;
28 prefs->default_minimum_page_scale_factor =
29 settings_.default_minimum_page_scale_factor;
30 prefs->default_maximum_page_scale_factor =
31 settings_.default_maximum_page_scale_factor;
32 prefs->shrinks_viewport_contents_to_fit =
33 settings_.shrinks_viewport_contents_to_fit;
34 prefs->use_solid_color_scrollbars = true;
35 }
36
37 const EngineSettings& SettingsManager::GetEngineSettings() const {
38 return settings_;
39 }
40
41 void SettingsManager::UpdateEngineSettings(const EngineSettings& settings) {
42 EngineSettings old_settings = settings_;
43 settings_ = settings;
44
45 if (settings_.record_whole_document != old_settings.record_whole_document) {
46 // Notify the observers that the web preferences have changed.
47 for (auto& observer : observer_list_)
48 observer.OnWebPreferencesChanged();
49 }
50 }
51
52 } // namespace engine
53 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/app/settings_manager.h ('k') | blimp/engine/app/settings_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698