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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 2870933002: Remove the unnecesary id_ member from the extension delegate (Closed)
Patch Set: Created 3 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index 577aaf7c764e93da31592fb64bae04dce3274880..d2dc850d220164f049350d3fc01e6cfb952aeac4 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -91,11 +91,11 @@ std::string CreateScopedIdentifier(const std::string& extension_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) {
+ const std::string& scoped_id) {
size_t index_of_separator = extension_id.length() + 1;
- DCHECK_LT(index_of_separator, id.length());
+ DCHECK_LT(index_of_separator, scoped_id.length());
- return id.substr(index_of_separator);
+ return scoped_id.substr(index_of_separator);
}
const gfx::ImageSkia CreateSolidColorImage(int width,
@@ -215,7 +215,6 @@ class NotificationsApiDelegate : public NotificationDelegate {
display_helper_(
ExtensionNotificationDisplayHelperFactory::GetForProfile(profile)),
extension_id_(extension_id),
- id_(id),
scoped_id_(CreateScopedIdentifier(extension_id, id)) {
DCHECK(api_function_);
DCHECK(display_helper_);
@@ -316,7 +315,7 @@ class NotificationsApiDelegate : public NotificationDelegate {
std::unique_ptr<base::ListValue> CreateBaseEventArgs() {
std::unique_ptr<base::ListValue> args(new base::ListValue());
- args->AppendString(id_);
+ args->AppendString(StripScopeFromIdentifier(extension_id_, scoped_id_));
return args;
}
@@ -329,7 +328,6 @@ class NotificationsApiDelegate : public NotificationDelegate {
ExtensionNotificationDisplayHelper* display_helper_;
const std::string extension_id_;
- const std::string id_;
const std::string scoped_id_;
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698