Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: chrome/browser/chromeos/login/multi_profile_first_run_notification.cc

Issue 110173004: Introduces the notifier id for multi-profile notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/system_notifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/multi_profile_first_run_notification.cc
diff --git a/chrome/browser/chromeos/login/multi_profile_first_run_notification.cc b/chrome/browser/chromeos/login/multi_profile_first_run_notification.cc
index 0b23ee3dfbde0dc6ce0a4fd84acdd6b8fb204b98..5976afca2cc410571e9682536dd3df7868fa8d3c 100644
--- a/chrome/browser/chromeos/login/multi_profile_first_run_notification.cc
+++ b/chrome/browser/chromeos/login/multi_profile_first_run_notification.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/login/multi_profile_first_run_notification.h"
+#include "ash/system/system_notifier.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string16.h"
#include "chrome/browser/chromeos/login/user_manager.h"
@@ -26,6 +27,31 @@ namespace {
const char kNotificationId[] = "chrome:://login/multiprofile";
+class MultiProfileFirstRunNotificationDelegate
+ : public message_center::NotificationDelegate {
+ public:
+ explicit MultiProfileFirstRunNotificationDelegate(
+ const base::Closure& user_close_callback)
+ : user_close_callback_(user_close_callback) {}
+
+ // Overridden from message_center::NotificationDelegate:
+ virtual void Display() OVERRIDE {}
+ virtual void Error() OVERRIDE {}
+ virtual void Close(bool by_user) OVERRIDE {
+ if (by_user)
+ user_close_callback_.Run();
+ }
+ virtual void Click() OVERRIDE {}
+
+ protected:
+ virtual ~MultiProfileFirstRunNotificationDelegate() {}
+
+ private:
+ base::Closure user_close_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(MultiProfileFirstRunNotificationDelegate);
+};
+
} // namespace
MultiProfileFirstRunNotification::MultiProfileFirstRunNotification()
@@ -61,9 +87,11 @@ void MultiProfileFirstRunNotification::UserProfilePrepared(
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_NOTIFICATION_ALERT),
display_source,
- message_center::NotifierId(),
+ message_center::NotifierId(
+ message_center::NotifierId::SYSTEM_COMPONENT,
+ ash::system_notifier::kNotifierMultiProfileFirstRun),
message_center::RichNotificationData(),
- new message_center::HandleNotificationClickedDelegate(
+ new MultiProfileFirstRunNotificationDelegate(
base::Bind(&MultiProfileFirstRunNotification::OnDismissed,
weak_ptr_factory_.GetWeakPtr(),
user_profile))));
« no previous file with comments | « ash/system/system_notifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698