Add ICU message format support
[chromium-blink-merge.git] / ios / public / provider / chrome / browser / browser_state / browser_state_info_cache.h
blobac7d1436372b2c21561ec02913eccc5fb55396ec
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 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_
8 #include <string>
10 #include "base/macros.h"
11 #include "base/observer_list.h"
12 #include "base/strings/string16.h"
14 namespace base {
15 class FilePath;
18 namespace ios {
20 class BrowserStateInfoCacheObserver;
22 // This class saves various information about browser states to local
23 // preferences.
24 class BrowserStateInfoCache {
25 public:
26 BrowserStateInfoCache();
27 virtual ~BrowserStateInfoCache();
29 // Adds and removes an observer.
30 void AddObserver(BrowserStateInfoCacheObserver* observer);
31 void RemoveObserver(BrowserStateInfoCacheObserver* observer);
33 // Gets and sets information related to browser states.
34 virtual size_t GetIndexOfBrowserStateWithPath(
35 const base::FilePath& profile_path) const = 0;
36 virtual void SetLocalAuthCredentialsOfBrowserStateAtIndex(
37 size_t index,
38 const std::string& credentials) = 0;
39 virtual void SetAuthInfoOfBrowserStateAtIndex(
40 size_t index,
41 const std::string& gaia_id,
42 const base::string16& user_name) = 0;
43 virtual void SetBrowserStateSigninRequiredAtIndex(size_t index,
44 bool value) = 0;
45 virtual void SetBrowserStateIsAuthErrorAtIndex(size_t index, bool value) = 0;
46 virtual std::string GetPasswordChangeDetectionTokenAtIndex(
47 size_t index) const = 0;
48 virtual void SetPasswordChangeDetectionTokenAtIndex(
49 size_t index,
50 const std::string& token) = 0;
52 protected:
53 // Methods calling the observers in |observer_list_|.
54 void NotifyBrowserStateAdded(const base::FilePath& path);
55 void NotifyBrowserStateRemoved(const base::FilePath& profile_path,
56 const base::string16& name);
58 private:
59 base::ObserverList<BrowserStateInfoCacheObserver, true> observer_list_;
61 DISALLOW_COPY_AND_ASSIGN(BrowserStateInfoCache);
64 } // namespace ios
66 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_