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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_pref_store.cc

Issue 615493005: c/b/supervised_user: Use range-based for where appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix CrOS 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 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/supervised_user/supervised_user_pref_store.h" 5 #include "chrome/browser/supervised_user/supervised_user_pref_store.h"
6 6
7 #include <vector>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/prefs/pref_value_map.h" 10 #include "base/prefs/pref_value_map.h"
9 #include "base/values.h" 11 #include "base/values.h"
10 #include "chrome/browser/prefs/incognito_mode_prefs.h" 12 #include "chrome/browser/prefs/incognito_mode_prefs.h"
11 #include "chrome/browser/supervised_user/supervised_user_constants.h" 13 #include "chrome/browser/supervised_user/supervised_user_constants.h"
12 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 14 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
13 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" 15 #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
14 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
15 17
16 using base::FundamentalValue; 18 using base::FundamentalValue;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 114
113 if (!old_prefs) { 115 if (!old_prefs) {
114 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true)); 116 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true));
115 return; 117 return;
116 } 118 }
117 119
118 std::vector<std::string> changed_prefs; 120 std::vector<std::string> changed_prefs;
119 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs); 121 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs);
120 122
121 // Send out change notifications. 123 // Send out change notifications.
122 for (std::vector<std::string>::const_iterator pref(changed_prefs.begin()); 124 for (const std::string& pref : changed_prefs) {
123 pref != changed_prefs.end(); 125 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(pref));
124 ++pref) {
125 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(*pref));
126 } 126 }
127 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698