1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ios/public/provider/chrome/browser/browser_state/browser_state_info_cache.h"
7 #include "ios/public/provider/chrome/browser/browser_state/browser_state_info_cache_observer.h"
11 BrowserStateInfoCache::BrowserStateInfoCache() {
14 BrowserStateInfoCache::~BrowserStateInfoCache() {
17 void BrowserStateInfoCache::AddObserver(
18 BrowserStateInfoCacheObserver
* observer
) {
19 observer_list_
.AddObserver(observer
);
22 void BrowserStateInfoCache::RemoveObserver(
23 BrowserStateInfoCacheObserver
* observer
) {
24 observer_list_
.RemoveObserver(observer
);
27 void BrowserStateInfoCache::NotifyBrowserStateAdded(
28 const base::FilePath
& path
) {
29 FOR_EACH_OBSERVER(BrowserStateInfoCacheObserver
, observer_list_
,
30 OnBrowserStateAdded(path
));
33 void BrowserStateInfoCache::NotifyBrowserStateRemoved(
34 const base::FilePath
& profile_path
,
35 const base::string16
& name
) {
36 FOR_EACH_OBSERVER(BrowserStateInfoCacheObserver
, observer_list_
,
37 OnBrowserStateWasRemoved(profile_path
, name
));