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

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.h

Issue 661643002: Adds a context message of the security origin for web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 11 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
Index: chrome/browser/notifications/platform_notification_service_impl.h
diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h
index da9bcbf93166c818d997d2512bb886329d89eef8..9b43b8404f2def4caf9945b0b0d5596c2e5cb484 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.h
+++ b/chrome/browser/notifications/platform_notification_service_impl.h
@@ -52,15 +52,13 @@ class PlatformNotificationServiceImpl
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
- int render_process_id,
base::Closure* cancel_callback) override;
void DisplayPersistentNotification(
content::BrowserContext* browser_context,
int64 service_worker_registration_id,
const GURL& origin,
const SkBitmap& icon,
- const content::PlatformNotificationData& notification_data,
- int render_process_id) override;
+ const content::PlatformNotificationData& notification_data) override;
void ClosePersistentNotification(
content::BrowserContext* browser_context,
const std::string& persistent_notification_id) override;
@@ -71,6 +69,8 @@ class PlatformNotificationServiceImpl
friend class PlatformNotificationServiceTest;
FRIEND_TEST_ALL_PREFIXES(
PlatformNotificationServiceTest, DisplayNameForOrigin);
+ FRIEND_TEST_ALL_PREFIXES(PlatformNotificationServiceTest,
+ TestWebOriginDisplayName);
PlatformNotificationServiceImpl();
~PlatformNotificationServiceImpl() override;
@@ -83,19 +83,22 @@ class PlatformNotificationServiceImpl
const GURL& origin,
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
- NotificationDelegate* delegate,
- int render_process_id) const;
+ NotificationDelegate* delegate) const;
// Overrides the Notification UI Manager to use to |manager|. Only to be
// used by tests. Tests are responsible for cleaning up after themselves.
void SetNotificationUIManagerForTesting(NotificationUIManager* manager);
- // Returns a display name for an origin in the process id, to be used in
- // permission infobar or on the frame of the notification toast. Different
- // from the origin itself when dealing with extensions.
- base::string16 DisplayNameForOriginInProcessId(Profile* profile,
- const GURL& origin,
- int process_id) const;
+ // Returns a display name for an origin, to be used in permission infobar or
+ // on the frame of the notification toast. Different from the origin itself
+ // when dealing with extensions.
+ base::string16 DisplayNameForOrigin(Profile* profile,
+ const GURL& origin) const;
+
+ // Translates a URL into a slightly more readable version that may omit
+ // the port and scheme for common cases.
+ static base::string16 WebOriginDisplayName(const GURL& origin,
Peter Beverloo 2015/01/14 19:18:14 nit: TODO for future consolidation?
dewittj 2015/01/15 22:31:35 Done.
+ const std::string& languages);
// Weak reference. Ownership maintains with the test.
NotificationUIManager* notification_ui_manager_for_tests_;

Powered by Google App Engine
This is Rietveld 408576698