| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ | 6 #define CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/signin/signin_internals_util.h" | 14 #include "chrome/browser/signin/signin_internals_util.h" |
| 15 #include "chrome/browser/signin/signin_manager.h" | 15 #include "chrome/browser/signin/signin_manager.h" |
| 16 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
| 17 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
| 18 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 18 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 19 | 19 |
| 20 class Profile; | 20 class Profile; |
| 21 | 21 |
| 22 // This class collects authentication, signin and token information | 22 // This class collects authentication, signin and token information |
| 23 // to propagate to about:signin-internals via SigninInternalsUI. | 23 // to propagate to about:signin-internals via SigninInternalsUI. |
| 24 class AboutSigninInternals | 24 class AboutSigninInternals |
| 25 : public ProfileKeyedService, | 25 : public BrowserContextKeyedService, |
| 26 public signin_internals_util::SigninDiagnosticsObserver { | 26 public signin_internals_util::SigninDiagnosticsObserver { |
| 27 public: | 27 public: |
| 28 class Observer { | 28 class Observer { |
| 29 public: | 29 public: |
| 30 // |info| will contain the dictionary of signin_status_ values as indicated | 30 // |info| will contain the dictionary of signin_status_ values as indicated |
| 31 // in the comments for GetSigninStatus() below. | 31 // in the comments for GetSigninStatus() below. |
| 32 virtual void OnSigninStateChanged(scoped_ptr<DictionaryValue> info) = 0; | 32 virtual void OnSigninStateChanged(scoped_ptr<DictionaryValue> info) = 0; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 AboutSigninInternals(); | 35 AboutSigninInternals(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 56 const std::string& token, | 56 const std::string& token, |
| 57 bool update_time) OVERRIDE; | 57 bool update_time) OVERRIDE; |
| 58 | 58 |
| 59 virtual void NotifyTokenReceivedFailure(const std::string& token_name, | 59 virtual void NotifyTokenReceivedFailure(const std::string& token_name, |
| 60 const std::string& error) OVERRIDE; | 60 const std::string& error) OVERRIDE; |
| 61 | 61 |
| 62 virtual void NotifyClearStoredToken(const std::string& token_name) OVERRIDE; | 62 virtual void NotifyClearStoredToken(const std::string& token_name) OVERRIDE; |
| 63 | 63 |
| 64 void Initialize(Profile* profile); | 64 void Initialize(Profile* profile); |
| 65 | 65 |
| 66 // ProfileKeyedService implementation. | 66 // BrowserContextKeyedService implementation. |
| 67 virtual void Shutdown() OVERRIDE; | 67 virtual void Shutdown() OVERRIDE; |
| 68 | 68 |
| 69 // Returns a dictionary of values in signin_status_ for use in | 69 // Returns a dictionary of values in signin_status_ for use in |
| 70 // about:signin-internals. The values are formatted as shown - | 70 // about:signin-internals. The values are formatted as shown - |
| 71 // | 71 // |
| 72 // { "signin_info" : | 72 // { "signin_info" : |
| 73 // [ {"title": "Basic Information", | 73 // [ {"title": "Basic Information", |
| 74 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] | 74 // "data": [List of {"label" : "foo-field", "value" : "foo"} elems] |
| 75 // }, | 75 // }, |
| 76 // { "title": "Detailed Information", | 76 // { "title": "Detailed Information", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 96 // Encapsulates the actual signin and token related values. | 96 // Encapsulates the actual signin and token related values. |
| 97 // Most of the values are mirrored in the prefs for persistance. | 97 // Most of the values are mirrored in the prefs for persistance. |
| 98 signin_internals_util::SigninStatus signin_status_; | 98 signin_internals_util::SigninStatus signin_status_; |
| 99 | 99 |
| 100 ObserverList<Observer> signin_observers_; | 100 ObserverList<Observer> signin_observers_; |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(AboutSigninInternals); | 102 DISALLOW_COPY_AND_ASSIGN(AboutSigninInternals); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 #endif // CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ | 105 #endif // CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_H_ |
| OLD | NEW |