diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-03-18 10:20:56 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-03-18 10:20:56 +0000 |
commit | a1401311d1ab56c4ed0a474bd38c108f75cb0cd9 (patch) | |
tree | 3437151d9ae1ce20a1e53a0d98c19ca01c786394 /chrome/browser/signin/signin_error_notifier_ash.h | |
parent | af5066f1e36c6579e74752647e6c584438f80f94 (diff) | |
download | chromium_org-a1401311d1ab56c4ed0a474bd38c108f75cb0cd9.tar.gz |
Merge from Chromium at DEPS revision 257591
This commit was generated by merge_to_master.py.
Change-Id: I0010df2ec3fbb5d4947cd026de2feb150ce7a6b5
Diffstat (limited to 'chrome/browser/signin/signin_error_notifier_ash.h')
-rw-r--r-- | chrome/browser/signin/signin_error_notifier_ash.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chrome/browser/signin/signin_error_notifier_ash.h b/chrome/browser/signin/signin_error_notifier_ash.h new file mode 100644 index 0000000000..a8d09f1299 --- /dev/null +++ b/chrome/browser/signin/signin_error_notifier_ash.h @@ -0,0 +1,47 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_ +#define CHROME_BROWSER_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_ + +#include <string> + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "base/strings/string16.h" +#include "chrome/browser/signin/signin_error_controller.h" +#include "components/keyed_service/core/keyed_service.h" + +class Profile; + +// Shows signin-related errors as notifications in Ash. +class SigninErrorNotifier : public SigninErrorController::Observer, + public KeyedService { + public: + SigninErrorNotifier(SigninErrorController* controller, Profile* profile); + virtual ~SigninErrorNotifier(); + + // KeyedService: + virtual void Shutdown() OVERRIDE; + + // SigninErrorController::Observer: + virtual void OnErrorChanged() OVERRIDE; + + private: + base::string16 GetMessageTitle() const; + base::string16 GetMessageBody() const; + + // The error controller to query for error details. + SigninErrorController* error_controller_; + + // The Profile this service belongs to. + Profile* profile_; + + // Used to keep track of the message center notification. + std::string notification_id_; + + DISALLOW_COPY_AND_ASSIGN(SigninErrorNotifier); +}; + +#endif // CHROME_BROWSER_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_ |