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

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

Issue 511473002: Remove implicit conversions from scoped_refptr to T* in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move download out Created 6 years, 3 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_settings_service.h" 5 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/prefs/json_pref_store.h" 10 #include "base/prefs/json_pref_store.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 path, sequenced_task_runner, scoped_ptr<PrefFilter>()); 64 path, sequenced_task_runner, scoped_ptr<PrefFilter>());
65 Init(store); 65 Init(store);
66 if (load_synchronously) 66 if (load_synchronously)
67 store_->ReadPrefs(); 67 store_->ReadPrefs();
68 else 68 else
69 store_->ReadPrefsAsync(NULL); 69 store_->ReadPrefsAsync(NULL);
70 } 70 }
71 71
72 void SupervisedUserSettingsService::Init( 72 void SupervisedUserSettingsService::Init(
73 scoped_refptr<PersistentPrefStore> store) { 73 scoped_refptr<PersistentPrefStore> store) {
74 DCHECK(!store_); 74 DCHECK(!store_.get());
75 store_ = store; 75 store_ = store;
76 store_->AddObserver(this); 76 store_->AddObserver(this);
77 } 77 }
78 78
79 void SupervisedUserSettingsService::Subscribe( 79 void SupervisedUserSettingsService::Subscribe(
80 const SettingsCallback& callback) { 80 const SettingsCallback& callback) {
81 if (IsReady()) { 81 if (IsReady()) {
82 scoped_ptr<base::DictionaryValue> settings = GetSettings(); 82 scoped_ptr<base::DictionaryValue> settings = GetSettings();
83 callback.Run(settings.get()); 83 callback.Run(settings.get());
84 } 84 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 void SupervisedUserSettingsService::InformSubscribers() { 377 void SupervisedUserSettingsService::InformSubscribers() {
378 if (!IsReady()) 378 if (!IsReady())
379 return; 379 return;
380 380
381 scoped_ptr<base::DictionaryValue> settings = GetSettings(); 381 scoped_ptr<base::DictionaryValue> settings = GetSettings();
382 for (std::vector<SettingsCallback>::iterator it = subscribers_.begin(); 382 for (std::vector<SettingsCallback>::iterator it = subscribers_.begin();
383 it != subscribers_.end(); ++it) { 383 it != subscribers_.end(); ++it) {
384 it->Run(settings.get()); 384 it->Run(settings.get());
385 } 385 }
386 } 386 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification_unittest.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698