Commit a1071da8 authored by mukai's avatar mukai Committed by Commit bot

Remove NotificationDelegate::process_id().

This field is not used at all.

BUG=408755
R=dewittj@chromium.org
TEST=build all succeeds

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

Cr-Commit-Position: refs/heads/master@{#295130}
parent 97fd1b87
...@@ -81,11 +81,8 @@ class NotificationsApiDelegate : public NotificationDelegate { ...@@ -81,11 +81,8 @@ class NotificationsApiDelegate : public NotificationDelegate {
profile_(profile), profile_(profile),
extension_id_(extension_id), extension_id_(extension_id),
id_(id), id_(id),
scoped_id_(CreateScopedIdentifier(extension_id, id)), scoped_id_(CreateScopedIdentifier(extension_id, id)) {
process_id_(-1) {
DCHECK(api_function_.get()); DCHECK(api_function_.get());
if (api_function_->render_view_host())
process_id_ = api_function->render_view_host()->GetProcess()->GetID();
} }
virtual void Display() OVERRIDE { } virtual void Display() OVERRIDE { }
...@@ -125,10 +122,6 @@ class NotificationsApiDelegate : public NotificationDelegate { ...@@ -125,10 +122,6 @@ class NotificationsApiDelegate : public NotificationDelegate {
return scoped_id_; return scoped_id_;
} }
virtual int process_id() const OVERRIDE {
return process_id_;
}
virtual content::WebContents* GetWebContents() const OVERRIDE { virtual content::WebContents* GetWebContents() const OVERRIDE {
// We're holding a reference to api_function_, so we know it'll be valid // We're holding a reference to api_function_, so we know it'll be valid
// until ReleaseRVH is called, and api_function_ (as a // until ReleaseRVH is called, and api_function_ (as a
...@@ -169,7 +162,6 @@ class NotificationsApiDelegate : public NotificationDelegate { ...@@ -169,7 +162,6 @@ class NotificationsApiDelegate : public NotificationDelegate {
const std::string extension_id_; const std::string extension_id_;
const std::string id_; const std::string id_;
const std::string scoped_id_; const std::string scoped_id_;
int process_id_;
DISALLOW_COPY_AND_ASSIGN(NotificationsApiDelegate); DISALLOW_COPY_AND_ASSIGN(NotificationsApiDelegate);
}; };
......
...@@ -482,29 +482,6 @@ MessageCenterNotificationManager::ProfileNotification::OnDownloadsCompleted() { ...@@ -482,29 +482,6 @@ MessageCenterNotificationManager::ProfileNotification::OnDownloadsCompleted() {
notification_.DoneRendering(); notification_.DoneRendering();
} }
std::string
MessageCenterNotificationManager::ProfileNotification::GetExtensionId() {
extensions::InfoMap* extension_info_map =
extensions::ExtensionSystem::Get(profile())->info_map();
extensions::ExtensionSet extensions;
extension_info_map->GetExtensionsWithAPIPermissionForSecurityOrigin(
notification().origin_url(),
notification().process_id(),
extensions::APIPermission::kNotifications,
&extensions);
DesktopNotificationService* desktop_service =
DesktopNotificationServiceFactory::GetForProfile(profile());
for (extensions::ExtensionSet::const_iterator iter = extensions.begin();
iter != extensions.end(); ++iter) {
if (desktop_service->IsNotifierEnabled(message_center::NotifierId(
message_center::NotifierId::APPLICATION, (*iter)->id()))) {
return (*iter)->id();
}
}
return std::string();
}
void void
MessageCenterNotificationManager::ProfileNotification::AddToAlternateProvider( MessageCenterNotificationManager::ProfileNotification::AddToAlternateProvider(
const std::string extension_id) { const std::string extension_id) {
......
...@@ -177,10 +177,6 @@ class MessageCenterNotificationManager ...@@ -177,10 +177,6 @@ class MessageCenterNotificationManager
Profile* profile() const { return profile_; } Profile* profile() const { return profile_; }
const Notification& notification() const { return notification_; } const Notification& notification() const { return notification_; }
// Returns extension_id if the notification originates from an extension,
// empty string otherwise.
std::string GetExtensionId();
// Route a new notification to an app/extension. // Route a new notification to an app/extension.
void AddToAlternateProvider(const std::string extension_id); void AddToAlternateProvider(const std::string extension_id);
......
...@@ -84,7 +84,6 @@ class Notification : public message_center::Notification { ...@@ -84,7 +84,6 @@ class Notification : public message_center::Notification {
// Id of the delegate embedded inside this instance. // Id of the delegate embedded inside this instance.
std::string delegate_id() const { return delegate()->id(); } std::string delegate_id() const { return delegate()->id(); }
int process_id() const { return delegate()->process_id(); }
content::WebContents* GetWebContents() const { content::WebContents* GetWebContents() const {
return delegate()->GetWebContents(); return delegate()->GetWebContents();
......
...@@ -4,6 +4,4 @@ ...@@ -4,6 +4,4 @@
#include "chrome/browser/notifications/notification_delegate.h" #include "chrome/browser/notifications/notification_delegate.h"
int NotificationDelegate::process_id() const { return -1; }
void NotificationDelegate::ReleaseRenderViewHost() {} void NotificationDelegate::ReleaseRenderViewHost() {}
...@@ -22,9 +22,6 @@ class NotificationDelegate : public message_center::NotificationDelegate { ...@@ -22,9 +22,6 @@ class NotificationDelegate : public message_center::NotificationDelegate {
// Returns unique id of the notification. // Returns unique id of the notification.
virtual std::string id() const = 0; virtual std::string id() const = 0;
// Returns the id of renderer process which creates the notification, or -1.
virtual int process_id() const;
// Returns the WebContents that generated the notification, or NULL. // Returns the WebContents that generated the notification, or NULL.
virtual content::WebContents* GetWebContents() const = 0; virtual content::WebContents* GetWebContents() const = 0;
......
...@@ -49,10 +49,6 @@ std::string NotificationObjectProxy::id() const { ...@@ -49,10 +49,6 @@ std::string NotificationObjectProxy::id() const {
return id_; return id_;
} }
int NotificationObjectProxy::process_id() const {
return render_process_id_;
}
content::WebContents* NotificationObjectProxy::GetWebContents() const { content::WebContents* NotificationObjectProxy::GetWebContents() const {
return content::WebContents::FromRenderFrameHost( return content::WebContents::FromRenderFrameHost(
content::RenderFrameHost::FromID(render_process_id_, render_frame_id_)); content::RenderFrameHost::FromID(render_process_id_, render_frame_id_));
......
...@@ -34,7 +34,6 @@ class NotificationObjectProxy ...@@ -34,7 +34,6 @@ class NotificationObjectProxy
virtual void Close(bool by_user) OVERRIDE; virtual void Close(bool by_user) OVERRIDE;
virtual void Click() OVERRIDE; virtual void Click() OVERRIDE;
virtual std::string id() const OVERRIDE; virtual std::string id() const OVERRIDE;
virtual int process_id() const OVERRIDE;
virtual content::WebContents* GetWebContents() const OVERRIDE; virtual content::WebContents* GetWebContents() const OVERRIDE;
protected: protected:
......
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