summaryrefslogtreecommitdiffstats
path: root/ui/message_center/fake_notifier_settings_provider.cc
diff options
context:
space:
mode:
authordewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 19:32:14 +0000
committerdewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 19:32:14 +0000
commit939c7b6ce5e3c7646081794739eeb163bf7d56ee (patch)
treebe0fdbfb3b1c51bac5410323531b7f2b84c6cf32 /ui/message_center/fake_notifier_settings_provider.cc
parent5b86531c03dc2e21e2e424b4ed0170793ad476ed (diff)
downloadchromium_src-939c7b6ce5e3c7646081794739eeb163bf7d56ee.zip
chromium_src-939c7b6ce5e3c7646081794739eeb163bf7d56ee.tar.gz
chromium_src-939c7b6ce5e3c7646081794739eeb163bf7d56ee.tar.bz2
Add a way for notifications to be linked from settings dialog.
Adds an event, onShowSettings, that is fired when the link is clicked. The link is only shown when the event is subscribed to. BUG=304208,286608 Review URL: https://codereview.chromium.org/26876006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/fake_notifier_settings_provider.cc')
-rw-r--r--ui/message_center/fake_notifier_settings_provider.cc29
1 files changed, 26 insertions, 3 deletions
diff --git a/ui/message_center/fake_notifier_settings_provider.cc b/ui/message_center/fake_notifier_settings_provider.cc
index f593ed9..c25f7a2 100644
--- a/ui/message_center/fake_notifier_settings_provider.cc
+++ b/ui/message_center/fake_notifier_settings_provider.cc
@@ -17,13 +17,14 @@ FakeNotifierSettingsProvider::NotifierGroupItem::~NotifierGroupItem() {
FakeNotifierSettingsProvider::FakeNotifierSettingsProvider()
: closed_called_count_(0),
- active_item_index_(0) {
-}
+ active_item_index_(0),
+ notifier_settings_requested_count_(0u) { }
FakeNotifierSettingsProvider::FakeNotifierSettingsProvider(
const std::vector<Notifier*>& notifiers)
: closed_called_count_(0),
- active_item_index_(0) {
+ active_item_index_(0),
+ notifier_settings_requested_count_(0u) {
NotifierGroupItem item;
item.group = new NotifierGroup(gfx::Image(),
UTF8ToUTF16("Fake name"),
@@ -78,6 +79,19 @@ void FakeNotifierSettingsProvider::OnNotifierSettingsClosing() {
closed_called_count_++;
}
+bool FakeNotifierSettingsProvider::NotifierHasAdvancedSettings(
+ const message_center::NotifierId& notifier_id) const {
+ if (!notifier_id_with_settings_handler_)
+ return false;
+ return *notifier_id_with_settings_handler_ == notifier_id;
+}
+
+void FakeNotifierSettingsProvider::OnNotifierAdvancedSettingsRequested(
+ const NotifierId& notifier_id,
+ const std::string* notification_id) {
+ notifier_settings_requested_count_++;
+}
+
void FakeNotifierSettingsProvider::AddObserver(
NotifierSettingsObserver* observer) {
}
@@ -98,8 +112,17 @@ void FakeNotifierSettingsProvider::AddGroup(
items_.push_back(item);
}
+void FakeNotifierSettingsProvider::SetNotifierHasAdvancedSettings(
+ const NotifierId& notifier_id) {
+ notifier_id_with_settings_handler_.reset(new NotifierId(notifier_id));
+}
+
int FakeNotifierSettingsProvider::closed_called_count() {
return closed_called_count_;
}
+size_t FakeNotifierSettingsProvider::settings_requested_count() const {
+ return notifier_settings_requested_count_;
+}
+
} // namespace message_center