| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 5 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/json_pref_store.h" | 8 #include "base/prefs/json_pref_store.h" |
| 9 #include "base/prefs/pref_filter.h" | 9 #include "base/prefs/pref_filter.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| 11 #include "base/prefs/pref_service_factory.h" | 11 #include "base/prefs/pref_service_factory.h" |
| 12 #include "base/prefs/scoped_user_pref_update.h" | 12 #include "base/prefs/scoped_user_pref_update.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/ui/zoom/zoom_event_manager.h" | |
| 16 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 18 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/host_zoom_map.h" | 18 #include "content/public/browser/host_zoom_map.h" |
| 20 #include "content/public/common/page_zoom.h" | 19 #include "content/public/common/page_zoom.h" |
| 20 #include "extensions/browser/ui/zoom/zoom_event_manager.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 std::string GetHash( | 24 std::string GetHash( |
| 25 const base::FilePath& relative_path) { | 25 const base::FilePath& relative_path) { |
| 26 size_t int_key = | 26 size_t int_key = |
| 27 BASE_HASH_NAMESPACE::hash<base::FilePath>()(relative_path); | 27 BASE_HASH_NAMESPACE::hash<base::FilePath>()(relative_path); |
| 28 return base::SizeTToString(int_key); | 28 return base::SizeTToString(int_key); |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // don't need to worry that host_zoom_dictionary is indirectly affected | 198 // don't need to worry that host_zoom_dictionary is indirectly affected |
| 199 // by calls to HostZoomMap::SetZoomLevelForHost(). | 199 // by calls to HostZoomMap::SetZoomLevelForHost(). |
| 200 ExtractPerHostZoomLevels(host_zoom_dictionary, | 200 ExtractPerHostZoomLevels(host_zoom_dictionary, |
| 201 true /* sanitize_partition_host_zoom_levels */); | 201 true /* sanitize_partition_host_zoom_levels */); |
| 202 } | 202 } |
| 203 zoom_subscription_ = host_zoom_map_->AddZoomLevelChangedCallback(base::Bind( | 203 zoom_subscription_ = host_zoom_map_->AddZoomLevelChangedCallback(base::Bind( |
| 204 &ChromeZoomLevelPrefs::OnZoomLevelChanged, base::Unretained(this))); | 204 &ChromeZoomLevelPrefs::OnZoomLevelChanged, base::Unretained(this))); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace chrome | 207 } // namespace chrome |
| OLD | NEW |