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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 665283002: Fix crash in ChromeZoomLevelPrefs::ExtractPerHostZoomLevels(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wjmResetZoomLevel
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 677
678 const base::DictionaryValue* host_zoom_dictionary = 678 const base::DictionaryValue* host_zoom_dictionary =
679 prefs->GetDictionary(prefs::kPerHostZoomLevelsDeprecated); 679 prefs->GetDictionary(prefs::kPerHostZoomLevelsDeprecated);
680 // Collect stats on frequency with which migrations are occuring. This measure 680 // Collect stats on frequency with which migrations are occuring. This measure
681 // is not perfect, since it will consider an un-migrated user with only 681 // is not perfect, since it will consider an un-migrated user with only
682 // default value as being already migrated, but it will catch all non-trivial 682 // default value as being already migrated, but it will catch all non-trivial
683 // migrations. 683 // migrations.
684 migrated |= !host_zoom_dictionary->empty(); 684 migrated |= !host_zoom_dictionary->empty();
685 UMA_HISTOGRAM_BOOLEAN("Settings.ZoomLevelPreferencesMigrated", migrated); 685 UMA_HISTOGRAM_BOOLEAN("Settings.ZoomLevelPreferencesMigrated", migrated);
686 686
687 zoom_level_prefs->ExtractPerHostZoomLevels(host_zoom_dictionary); 687 zoom_level_prefs->ExtractPerHostZoomLevels(
688 host_zoom_dictionary, prefs::kPerHostZoomLevelsDeprecated);
688 689
689 // We're done migrating the profile per-host zoom level values, so we clear 690 // We're done migrating the profile per-host zoom level values, so we clear
690 // them all. 691 // them all.
691 DictionaryPrefUpdate host_zoom_dictionary_update( 692 DictionaryPrefUpdate host_zoom_dictionary_update(
692 prefs, prefs::kPerHostZoomLevelsDeprecated); 693 prefs, prefs::kPerHostZoomLevelsDeprecated);
693 host_zoom_dictionary_update->Clear(); 694 host_zoom_dictionary_update->Clear();
694 } 695 }
695 696
696 } // namespace chrome 697 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/zoom/chrome_zoom_level_prefs.h » ('j') | chrome/browser/ui/zoom/chrome_zoom_level_prefs.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698