Make sync/sign-in error notifications actionable on click.

Since there is only one button, clicking the notification will perform
the same action as the button per PM/designer decision.

BUG=393680
R=atwilson@chromium.org
TEST=manual

Review URL: https://codereview.chromium.org/395463005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283438 0039d316-1c4b-4281-b951-d872f2087c98
parent b88d2c6e
...@@ -62,6 +62,8 @@ class SigninNotificationDelegate : public NotificationDelegate { ...@@ -62,6 +62,8 @@ class SigninNotificationDelegate : public NotificationDelegate {
virtual ~SigninNotificationDelegate(); virtual ~SigninNotificationDelegate();
private: private:
void FixSignIn();
// Unique id of the notification. // Unique id of the notification.
const std::string id_; const std::string id_;
...@@ -94,9 +96,22 @@ bool SigninNotificationDelegate::HasClickedListener() { ...@@ -94,9 +96,22 @@ bool SigninNotificationDelegate::HasClickedListener() {
} }
void SigninNotificationDelegate::Click() { void SigninNotificationDelegate::Click() {
FixSignIn();
} }
void SigninNotificationDelegate::ButtonClick(int button_index) { void SigninNotificationDelegate::ButtonClick(int button_index) {
FixSignIn();
}
std::string SigninNotificationDelegate::id() const {
return id_;
}
content::WebContents* SigninNotificationDelegate::GetWebContents() const {
return NULL;
}
void SigninNotificationDelegate::FixSignIn() {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
chrome::AttemptUserExit(); chrome::AttemptUserExit();
#else #else
...@@ -116,14 +131,6 @@ void SigninNotificationDelegate::ButtonClick(int button_index) { ...@@ -116,14 +131,6 @@ void SigninNotificationDelegate::ButtonClick(int button_index) {
#endif #endif
} }
std::string SigninNotificationDelegate::id() const {
return id_;
}
content::WebContents* SigninNotificationDelegate::GetWebContents() const {
return NULL;
}
} // namespace } // namespace
SigninErrorNotifier::SigninErrorNotifier(SigninErrorController* controller, SigninErrorNotifier::SigninErrorNotifier(SigninErrorController* controller,
......
...@@ -57,6 +57,8 @@ class SyncNotificationDelegate : public NotificationDelegate { ...@@ -57,6 +57,8 @@ class SyncNotificationDelegate : public NotificationDelegate {
virtual ~SyncNotificationDelegate(); virtual ~SyncNotificationDelegate();
private: private:
void ShowSyncSetup();
// Unique id of the notification. // Unique id of the notification.
const std::string id_; const std::string id_;
...@@ -89,6 +91,11 @@ bool SyncNotificationDelegate::HasClickedListener() { ...@@ -89,6 +91,11 @@ bool SyncNotificationDelegate::HasClickedListener() {
} }
void SyncNotificationDelegate::Click() { void SyncNotificationDelegate::Click() {
ShowSyncSetup();
}
void SyncNotificationDelegate::ButtonClick(int button_index) {
ShowSyncSetup();
} }
std::string SyncNotificationDelegate::id() const { std::string SyncNotificationDelegate::id() const {
...@@ -99,7 +106,7 @@ content::WebContents* SyncNotificationDelegate::GetWebContents() const { ...@@ -99,7 +106,7 @@ content::WebContents* SyncNotificationDelegate::GetWebContents() const {
return NULL; return NULL;
} }
void SyncNotificationDelegate::ButtonClick(int button_index) { void SyncNotificationDelegate::ShowSyncSetup() {
LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_);
if (login_ui->current_login_ui()) { if (login_ui->current_login_ui()) {
// TODO(michaelpg): The LoginUI might be on an inactive desktop. // TODO(michaelpg): The LoginUI might be on an inactive desktop.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment