| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <blimp/engine/app/settings_manager.h> | 5 #include <blimp/engine/app/settings_manager.h> |
| 6 #include "content/public/browser/render_view_host.h" | 6 #include "content/public/browser/render_view_host.h" |
| 7 #include "content/public/common/web_preferences.h" | 7 #include "content/public/common/web_preferences.h" |
| 8 | 8 |
| 9 namespace blimp { | 9 namespace blimp { |
| 10 namespace engine { | 10 namespace engine { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 void SettingsManager::UpdateWebkitPreferences(content::WebPreferences* prefs) { | 24 void SettingsManager::UpdateWebkitPreferences(content::WebPreferences* prefs) { |
| 25 prefs->record_whole_document = settings_.record_whole_document; | 25 prefs->record_whole_document = settings_.record_whole_document; |
| 26 prefs->animation_policy = settings_.animation_policy; | 26 prefs->animation_policy = settings_.animation_policy; |
| 27 prefs->viewport_meta_enabled = settings_.viewport_meta_enabled; | 27 prefs->viewport_meta_enabled = settings_.viewport_meta_enabled; |
| 28 prefs->default_minimum_page_scale_factor = | 28 prefs->default_minimum_page_scale_factor = |
| 29 settings_.default_minimum_page_scale_factor; | 29 settings_.default_minimum_page_scale_factor; |
| 30 prefs->default_maximum_page_scale_factor = | 30 prefs->default_maximum_page_scale_factor = |
| 31 settings_.default_maximum_page_scale_factor; | 31 settings_.default_maximum_page_scale_factor; |
| 32 prefs->shrinks_viewport_contents_to_fit = | 32 prefs->shrinks_viewport_contents_to_fit = |
| 33 settings_.shrinks_viewport_contents_to_fit; | 33 settings_.shrinks_viewport_contents_to_fit; |
| 34 prefs->use_solid_color_scrollbars = true; |
| 34 } | 35 } |
| 35 | 36 |
| 36 const EngineSettings& SettingsManager::GetEngineSettings() const { | 37 const EngineSettings& SettingsManager::GetEngineSettings() const { |
| 37 return settings_; | 38 return settings_; |
| 38 } | 39 } |
| 39 | 40 |
| 40 void SettingsManager::UpdateEngineSettings(const EngineSettings& settings) { | 41 void SettingsManager::UpdateEngineSettings(const EngineSettings& settings) { |
| 41 EngineSettings old_settings = settings_; | 42 EngineSettings old_settings = settings_; |
| 42 settings_ = settings; | 43 settings_ = settings; |
| 43 | 44 |
| 44 if (settings_.record_whole_document != old_settings.record_whole_document) { | 45 if (settings_.record_whole_document != old_settings.record_whole_document) { |
| 45 // Notify the observers that the web preferences have changed. | 46 // Notify the observers that the web preferences have changed. |
| 46 for (auto& observer : observer_list_) | 47 for (auto& observer : observer_list_) |
| 47 observer.OnWebPreferencesChanged(); | 48 observer.OnWebPreferencesChanged(); |
| 48 } | 49 } |
| 49 } | 50 } |
| 50 | 51 |
| 51 } // namespace engine | 52 } // namespace engine |
| 52 } // namespace blimp | 53 } // namespace blimp |
| OLD | NEW |