summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 03:46:01 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 03:46:01 +0000
commitd1948c322511cd1da5dc057dffad447259ed8ecf (patch)
treeffccd9784e5d515b85fd483b0aeee7296e47d7a5
parentaff981241af45937bc8b28cb2d3df1c08eeb2db1 (diff)
downloadchromium_src-d1948c322511cd1da5dc057dffad447259ed8ecf.zip
chromium_src-d1948c322511cd1da5dc057dffad447259ed8ecf.tar.gz
chromium_src-d1948c322511cd1da5dc057dffad447259ed8ecf.tar.bz2
Revert 201932 "Add API function chrome.notifications.getAll"
Broke Mac ASAN Tests (1): http://build.chromium.org/p/chromium.memory/builders/Mac%20ASAN%20Tests%20%281%29/builds/10683 NotificationsApiTest.TestGetAll: dyld: warning, unknown environment variable: DYLD_NO_PIE dyld: warning, unknown environment variable: DYLD_NO_PIE dyld: warning, unknown environment variable: DYLD_NO_PIE dyld: warning, unknown environment variable: DYLD_NO_PIE [6552:3847:0523/180035:INFO:gpu_command_buffer_stub.cc(468)] Created virtual GL context. ../../chrome/browser/extensions/api/notifications/notifications_apitest.cc:331: Failure Value of: kNotificationsToCreate Actual: 4 Expected: return_value->size() Which is: 0 > Add API function chrome.notifications.getAll > > This function returns an object whose keys are the notification > IDs of all notifications created by that extension. > > BUG=240924 > > Review URL: https://chromiumcodereview.appspot.com/14767029 TBR=dewittj@chromium.org Review URL: https://codereview.chromium.org/15925003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201969 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/notifications/notifications_api.cc64
-rw-r--r--chrome/browser/extensions/api/notifications/notifications_api.h14
-rw-r--r--chrome/browser/extensions/api/notifications/notifications_apitest.cc78
-rw-r--r--chrome/browser/extensions/extension_function_histogram_value.h1
-rw-r--r--chrome/browser/notifications/balloon_notification_ui_manager.cc21
-rw-r--r--chrome/browser/notifications/balloon_notification_ui_manager.h3
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.cc21
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.h3
-rw-r--r--chrome/browser/notifications/notification_ui_manager.cc1
-rw-r--r--chrome/browser/notifications/notification_ui_manager.h7
-rw-r--r--chrome/browser/notifications/notification_ui_manager_impl.cc15
-rw-r--r--chrome/browser/notifications/notification_ui_manager_impl.h3
-rw-r--r--chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc15
-rw-r--r--chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc13
-rw-r--r--chrome/common/extensions/api/notifications.idl6
15 files changed, 18 insertions, 247 deletions
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index 597cc8a..9865aff 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -29,23 +29,6 @@ namespace {
const char kResultKey[] = "result";
-// Given an extension id and another id, returns an id that is unique
-// relative to other extensions.
-std::string CreateScopedIdentifier(const std::string& extension_id,
- const std::string& id) {
- return extension_id + "-" + id;
-}
-
-// Removes the unique internal identifier to send the ID as the
-// extension expects it.
-std::string StripScopeFromIdentifier(const std::string& extension_id,
- const std::string& id) {
- size_t index_of_separator = extension_id.length() + 1;
- DCHECK_LT(index_of_separator, id.length());
-
- return id.substr(index_of_separator);
-}
-
class NotificationsApiDelegate : public NotificationDelegate {
public:
NotificationsApiDelegate(ApiFunction* api_function,
@@ -63,6 +46,13 @@ class NotificationsApiDelegate : public NotificationDelegate {
process_id_ = api_function->render_view_host()->GetProcess()->GetID();
}
+ // Given an extension id and another id, returns an id that is unique
+ // relative to other extensions.
+ static std::string CreateScopedIdentifier(const std::string& extension_id,
+ const std::string& id) {
+ return extension_id + "-" + id;
+ }
+
virtual void Display() OVERRIDE { }
virtual void Error() OVERRIDE {
@@ -145,7 +135,10 @@ bool NotificationsApiFunction::IsNotificationsApiAvailable() {
// We need to check this explicitly rather than letting
// _permission_features.json enforce it, because we're sharing the
// chrome.notifications permissions namespace with WebKit notifications.
- return GetExtension()->is_platform_app() || GetExtension()->is_extension();
+ if (!(GetExtension()->is_platform_app() || GetExtension()->is_extension()))
+ return false;
+
+ return true;
}
NotificationsApiFunction::NotificationsApiFunction() {
@@ -340,8 +333,9 @@ bool NotificationsUpdateFunction::RunNotificationsApi() {
params_ = api::notifications::Update::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
- if (g_browser_process->notification_ui_manager()->DoesIdExist(
- CreateScopedIdentifier(extension_->id(), params_->notification_id))) {
+ if (g_browser_process->notification_ui_manager()->
+ DoesIdExist(NotificationsApiDelegate::CreateScopedIdentifier(
+ extension_->id(), params_->notification_id))) {
CreateNotification(params_->notification_id, &params_->options);
SetResult(Value::CreateBooleanValue(true));
} else {
@@ -363,8 +357,9 @@ bool NotificationsClearFunction::RunNotificationsApi() {
params_ = api::notifications::Clear::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
- bool cancel_result = g_browser_process->notification_ui_manager()->CancelById(
- CreateScopedIdentifier(extension_->id(), params_->notification_id));
+ bool cancel_result = g_browser_process->notification_ui_manager()->
+ CancelById(NotificationsApiDelegate::CreateScopedIdentifier(
+ extension_->id(), params_->notification_id));
SetResult(Value::CreateBooleanValue(cancel_result));
SendResponse(true);
@@ -372,29 +367,4 @@ bool NotificationsClearFunction::RunNotificationsApi() {
return true;
}
-NotificationsGetAllFunction::NotificationsGetAllFunction() {}
-
-NotificationsGetAllFunction::~NotificationsGetAllFunction() {}
-
-bool NotificationsGetAllFunction::RunNotificationsApi() {
- NotificationUIManager* notification_ui_manager =
- g_browser_process->notification_ui_manager();
- std::set<std::string> notification_ids =
- notification_ui_manager->GetAllIdsByProfileAndSourceOrigin(
- profile_, extension_->url());
-
- scoped_ptr<DictionaryValue> result(new DictionaryValue());
-
- for (std::set<std::string>::iterator iter = notification_ids.begin();
- iter != notification_ids.end(); iter++) {
- result->SetBooleanWithoutPathExpansion(
- StripScopeFromIdentifier(extension_->id(), *iter), true);
- }
-
- SetResult(result.release());
- SendResponse(true);
-
- return true;
-}
-
} // namespace extensions
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.h b/chrome/browser/extensions/api/notifications/notifications_api.h
index 447d0bf..8635a39 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.h
+++ b/chrome/browser/extensions/api/notifications/notifications_api.h
@@ -89,20 +89,6 @@ class NotificationsClearFunction : public NotificationsApiFunction {
DECLARE_EXTENSION_FUNCTION("notifications.clear", NOTIFICATIONS_CLEAR)
};
-class NotificationsGetAllFunction : public NotificationsApiFunction {
- public:
- NotificationsGetAllFunction();
-
- // UIThreadExtensionFunction:
- virtual bool RunNotificationsApi() OVERRIDE;
-
- protected:
- virtual ~NotificationsGetAllFunction();
-
- private:
- DECLARE_EXTENSION_FUNCTION("notifications.getAll", NOTIFICATIONS_GET_ALL)
-};
-
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_
diff --git a/chrome/browser/extensions/api/notifications/notifications_apitest.cc b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
index 08aa1bd..59a48ac 100644
--- a/chrome/browser/extensions/api/notifications/notifications_apitest.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/stringprintf.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/notifications/notifications_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
@@ -13,7 +12,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
#include "ui/message_center/message_center.h"
-#include "ui/message_center/message_center_switches.h"
#include "ui/message_center/message_center_util.h"
// TODO(kbr): remove: http://crbug.com/222296
@@ -262,82 +260,6 @@ IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestMultipleItemNotification) {
ASSERT_TRUE(notification_id.length() > 0);
}
-#if defined(OS_LINUX) && defined(USE_AURA)
-#define MAYBE_TestGetAll DISABLED_TestGetAll
-#else
-#define MAYBE_TestGetAll TestGetAll
-#endif
-
-IN_PROC_BROWSER_TEST_F(NotificationsApiTest, MAYBE_TestGetAll) {
- scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
-
- {
- scoped_refptr<extensions::NotificationsGetAllFunction>
- notification_get_all_function(
- new extensions::NotificationsGetAllFunction());
- notification_get_all_function->set_extension(empty_extension.get());
- notification_get_all_function->set_has_callback(true);
- scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
- notification_get_all_function, "[]", browser(), utils::NONE));
-
- base::DictionaryValue* return_value;
- ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
- ASSERT_TRUE(result->GetAsDictionary(&return_value));
- ASSERT_TRUE(return_value->size() == 0);
- }
-
- const unsigned int kNotificationsToCreate = 4;
-
- for (unsigned int i = 0; i < kNotificationsToCreate; i++) {
- scoped_refptr<extensions::NotificationsCreateFunction>
- notification_create_function(
- new extensions::NotificationsCreateFunction());
-
- notification_create_function->set_extension(empty_extension.get());
- notification_create_function->set_has_callback(true);
-
- scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
- notification_create_function,
- base::StringPrintf("[\"identifier-%u\", "
- "{"
- "\"type\": \"list\","
- "\"iconUrl\": \"an/image/that/does/not/exist.png\","
- "\"title\": \"Title\","
- "\"message\": \"Message.\","
- "\"items\": ["
- " {\"title\": \"Grace Goe\","
- " \"message\": \"I saw Frank steal a sandwich :-)\"}"
- "],"
- "\"priority\": 1,"
- "\"eventTime\": 1361488019.9999999"
- "}]",
- i),
- browser(),
- utils::NONE));
- }
-
- {
- scoped_refptr<extensions::NotificationsGetAllFunction>
- notification_get_all_function(
- new extensions::NotificationsGetAllFunction());
- notification_get_all_function->set_extension(empty_extension.get());
- notification_get_all_function->set_has_callback(true);
- scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
- notification_get_all_function, "[]", browser(), utils::NONE));
-
- base::DictionaryValue* return_value;
- ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
- ASSERT_TRUE(result->GetAsDictionary(&return_value));
- ASSERT_EQ(return_value->size(), kNotificationsToCreate);
- bool dictionary_bool = false;
- for (unsigned int i = 0; i < kNotificationsToCreate; i++) {
- std::string id = base::StringPrintf("identifier-%u", i);
- ASSERT_TRUE(return_value->GetBoolean(id, &dictionary_bool));
- ASSERT_TRUE(dictionary_bool);
- }
- }
-}
-
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestEvents) {
#if defined(OS_MACOSX)
// TODO(kbr): re-enable: http://crbug.com/222296
diff --git a/chrome/browser/extensions/extension_function_histogram_value.h b/chrome/browser/extensions/extension_function_histogram_value.h
index b1c7f05..44b709f 100644
--- a/chrome/browser/extensions/extension_function_histogram_value.h
+++ b/chrome/browser/extensions/extension_function_histogram_value.h
@@ -530,7 +530,6 @@ enum HistogramValue {
WEBVIEW_INSERTCSS,
METRICSPRIVATE_GETISCRASHRECORDINGENABLED,
IDENTITYPRIVATE_GETRESOURCES,
- NOTIFICATIONS_GET_ALL,
ENUM_BOUNDARY // Last entry: Add new entries above.
};
diff --git a/chrome/browser/notifications/balloon_notification_ui_manager.cc b/chrome/browser/notifications/balloon_notification_ui_manager.cc
index 7c942d8..6388397 100644
--- a/chrome/browser/notifications/balloon_notification_ui_manager.cc
+++ b/chrome/browser/notifications/balloon_notification_ui_manager.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/idle.h"
#include "chrome/browser/notifications/balloon_collection.h"
#include "chrome/browser/notifications/notification.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
@@ -60,26 +59,6 @@ bool BalloonNotificationUIManager::CancelById(const std::string& id) {
return balloon_collection_->RemoveById(id);
}
-std::set<std::string>
-BalloonNotificationUIManager::GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) {
- std::set<std::string> notification_ids =
- NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin(profile,
- source);
-
- const BalloonCollection::Balloons& balloons =
- balloon_collection_->GetActiveBalloons();
- for (BalloonCollection::Balloons::const_iterator iter = balloons.begin();
- iter != balloons.end(); ++iter) {
- if (profile->IsSameProfile((*iter)->profile()) &&
- source == (*iter)->notification().origin_url()) {
- notification_ids.insert((*iter)->notification().notification_id());
- }
- }
- return notification_ids;
-}
-
bool BalloonNotificationUIManager::CancelAllBySourceOrigin(const GURL& source) {
// Same pattern as CancelById, but more complicated than the above
// because there may be multiple notifications from the same source.
diff --git a/chrome/browser/notifications/balloon_notification_ui_manager.h b/chrome/browser/notifications/balloon_notification_ui_manager.h
index 953891e..12bb78e 100644
--- a/chrome/browser/notifications/balloon_notification_ui_manager.h
+++ b/chrome/browser/notifications/balloon_notification_ui_manager.h
@@ -36,9 +36,6 @@ class BalloonNotificationUIManager
// NotificationUIManager:
virtual bool DoesIdExist(const std::string& notification_id) OVERRIDE;
virtual bool CancelById(const std::string& notification_id) OVERRIDE;
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) OVERRIDE;
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE;
virtual bool CancelAllByProfile(Profile* profile) OVERRIDE;
virtual void CancelAll() OVERRIDE;
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 7a4a92c..df02256 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -70,25 +70,6 @@ bool MessageCenterNotificationManager::CancelById(const std::string& id) {
return true;
}
-std::set<std::string>
-MessageCenterNotificationManager::GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) {
-
- std::set<std::string> notification_ids =
- NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin(profile,
- source);
-
- for (NotificationMap::iterator iter = profile_notifications_.begin();
- iter != profile_notifications_.end(); iter++) {
- if ((*iter).second->notification().origin_url() == source &&
- profile->IsSameProfile((*iter).second->profile())) {
- notification_ids.insert(iter->first);
- }
- }
- return notification_ids;
-}
-
bool MessageCenterNotificationManager::CancelAllBySourceOrigin(
const GURL& source) {
// Same pattern as CancelById, but more complicated than the above
@@ -113,7 +94,7 @@ bool MessageCenterNotificationManager::CancelAllByProfile(Profile* profile) {
for (NotificationMap::iterator loopiter = profile_notifications_.begin();
loopiter != profile_notifications_.end(); ) {
NotificationMap::iterator curiter = loopiter++;
- if (profile->IsSameProfile((*curiter).second->profile())) {
+ if ((*curiter).second->profile() == profile) {
message_center_->RemoveNotification(curiter->first, /* by_user */ false);
removed = true;
}
diff --git a/chrome/browser/notifications/message_center_notification_manager.h b/chrome/browser/notifications/message_center_notification_manager.h
index b82e012..75d625c 100644
--- a/chrome/browser/notifications/message_center_notification_manager.h
+++ b/chrome/browser/notifications/message_center_notification_manager.h
@@ -34,9 +34,6 @@ class MessageCenterNotificationManager
// NotificationUIManager
virtual bool DoesIdExist(const std::string& notification_id) OVERRIDE;
virtual bool CancelById(const std::string& notification_id) OVERRIDE;
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) OVERRIDE;
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE;
virtual bool CancelAllByProfile(Profile* profile) OVERRIDE;
virtual void CancelAll() OVERRIDE;
diff --git a/chrome/browser/notifications/notification_ui_manager.cc b/chrome/browser/notifications/notification_ui_manager.cc
index 2c73a9e..1b1d62dc 100644
--- a/chrome/browser/notifications/notification_ui_manager.cc
+++ b/chrome/browser/notifications/notification_ui_manager.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/notifications/balloon_notification_ui_manager.h"
#include "chrome/browser/notifications/message_center_notification_manager.h"
-#include "chrome/browser/profiles/profile.h"
#include "ui/message_center/message_center_util.h"
// static
diff --git a/chrome/browser/notifications/notification_ui_manager.h b/chrome/browser/notifications/notification_ui_manager.h
index 6257939..92dfe6e 100644
--- a/chrome/browser/notifications/notification_ui_manager.h
+++ b/chrome/browser/notifications/notification_ui_manager.h
@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
-#include <set>
#include <string>
#include <vector>
@@ -37,12 +36,6 @@ class NotificationUIManager {
// displayed or in the queue. Returns true if anything was removed.
virtual bool CancelById(const std::string& notification_id) = 0;
- // Adds the notification_id for each outstanding notification to the set
- // |notification_ids| (must not be NULL).
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) = 0;
-
// Removes notifications matching the |source_origin| (which could be an
// extension ID). Returns true if anything was removed.
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0;
diff --git a/chrome/browser/notifications/notification_ui_manager_impl.cc b/chrome/browser/notifications/notification_ui_manager_impl.cc
index e7fc422..0bda94d 100644
--- a/chrome/browser/notifications/notification_ui_manager_impl.cc
+++ b/chrome/browser/notifications/notification_ui_manager_impl.cc
@@ -95,21 +95,6 @@ bool NotificationUIManagerImpl::CancelById(const std::string& id) {
return false;
}
-std::set<std::string>
-NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) {
- std::set<std::string> notification_ids;
- for (NotificationDeque::iterator iter = show_queue_.begin();
- iter != show_queue_.end(); iter++) {
- if ((*iter)->notification().origin_url() == source &&
- profile->IsSameProfile((*iter)->profile())) {
- notification_ids.insert((*iter)->notification().notification_id());
- }
- }
- return notification_ids;
-}
-
bool NotificationUIManagerImpl::CancelAllBySourceOrigin(const GURL& source) {
// Same pattern as CancelById, but more complicated than the above
// because there may be multiple notifications from the same source.
diff --git a/chrome/browser/notifications/notification_ui_manager_impl.h b/chrome/browser/notifications/notification_ui_manager_impl.h
index 273beea..7e56336 100644
--- a/chrome/browser/notifications/notification_ui_manager_impl.h
+++ b/chrome/browser/notifications/notification_ui_manager_impl.h
@@ -36,9 +36,6 @@ class NotificationUIManagerImpl
Profile* profile) OVERRIDE;
virtual bool DoesIdExist(const std::string& notification_id) OVERRIDE;
virtual bool CancelById(const std::string& notification_id) OVERRIDE;
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) OVERRIDE;
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE;
virtual bool CancelAllByProfile(Profile* profile) OVERRIDE;
virtual void CancelAll() OVERRIDE;
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
index 2fc4db7..0fee623 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
#include "chrome/browser/notifications/sync_notifier/synced_notification.h"
-#include "chrome/browser/profiles/profile.h"
#include "sync/api/sync_change.h"
#include "sync/api/sync_change_processor.h"
#include "sync/api/sync_error_factory.h"
@@ -123,7 +122,6 @@ class StubNotificationUIManager : public NotificationUIManager {
OVERRIDE {
// Make a deep copy of the notification that we can inspect.
notification_ = notification;
- profile_ = profile;
}
// Returns true if any notifications match the supplied ID, either currently
@@ -138,18 +136,6 @@ class StubNotificationUIManager : public NotificationUIManager {
return false;
}
- // Adds the notification_id for each outstanding notification to the set
- // |notification_ids| (must not be NULL).
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) OVERRIDE {
- std::set<std::string> notification_ids;
- if (source == notification_.origin_url() &&
- profile->IsSameProfile(profile_))
- notification_ids.insert(notification_.notification_id());
- return notification_ids;
- }
-
// Removes notifications matching the |source_origin| (which could be an
// extension ID). Returns true if anything was removed.
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE {
@@ -171,7 +157,6 @@ class StubNotificationUIManager : public NotificationUIManager {
private:
DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager);
Notification notification_;
- Profile* profile_;
};
// Dummy SyncChangeProcessor used to help review what SyncChanges are pushed
diff --git a/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc b/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc
index 6d7061d..87810cc 100644
--- a/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc
+++ b/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/notifications/sync_notifier/synced_notification.h"
-#include "chrome/browser/profiles/profile.h"
#include "sync/api/sync_data.h"
#include "sync/protocol/sync.pb.h"
#include "sync/protocol/synced_notification_specifics.pb.h"
@@ -88,7 +87,6 @@ class StubNotificationUIManager : public NotificationUIManager {
OVERRIDE {
// Make a deep copy of the notification that we can inspect.
notification_ = notification;
- profile_ = profile;
}
// Returns true if any notifications match the supplied ID, either currently
@@ -103,16 +101,6 @@ class StubNotificationUIManager : public NotificationUIManager {
return false;
}
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
- const GURL& source) OVERRIDE {
- std::set<std::string> notification_ids;
- if (source == notification_.origin_url() &&
- profile->IsSameProfile(profile_))
- notification_ids.insert(notification_.notification_id());
- return notification_ids;
- }
-
// Removes notifications matching the |source_origin| (which could be an
// extension ID). Returns true if anything was removed.
virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE {
@@ -134,7 +122,6 @@ class StubNotificationUIManager : public NotificationUIManager {
private:
DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager);
Notification notification_;
- Profile* profile_;
};
class SyncedNotificationTest : public testing::Test {
diff --git a/chrome/common/extensions/api/notifications.idl b/chrome/common/extensions/api/notifications.idl
index 059febf..1b339e6 100644
--- a/chrome/common/extensions/api/notifications.idl
+++ b/chrome/common/extensions/api/notifications.idl
@@ -67,8 +67,6 @@ namespace notifications {
callback ClearCallback = void (boolean wasCleared);
- callback GetAllCallback = void (object notifications);
-
interface Functions {
// Creates and displays a notification having the contents in |options|,
// identified by the id |notificationId|. If |notificationId| is empty,
@@ -91,10 +89,6 @@ namespace notifications {
// corresponding notification. |callback| indicates whether a matching
// notification existed.
static void clear(DOMString notificationId, ClearCallback callback);
-
- // |callback| is executed with the set of notification_ids currently in
- // the system.
- static void getAll(GetAllCallback callback);
};
interface Events {