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

Unified Diff: content/browser/content_browser_client.h

Issue 7125006: Get rid of Chrome notifications dependency, and instead go through ContentBrowserClient to show U... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browsertest Created 9 years, 6 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: content/browser/content_browser_client.h
===================================================================
--- content/browser/content_browser_client.h (revision 88079)
+++ content/browser/content_browser_client.h (working copy)
@@ -10,6 +10,7 @@
#include "base/callback_old.h"
#include "content/common/content_client.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h"
class BrowserRenderProcessHost;
class CommandLine;
@@ -23,6 +24,7 @@
class SSLClientAuthHandler;
class TabContents;
class WorkerProcessHost;
+struct DesktopNotificationHostMsg_Show_Params;
namespace net {
class CookieList;
@@ -36,7 +38,8 @@
class ResourceContext;
class WebUIFactory;
-// Embedder API for participating in browser logic.
+// Embedder API for participating in browser logic. The methods are assumed to
+// be called on the UI thread unless otherwise specified.
class ContentBrowserClient {
public:
// Notifies that a new RenderHostView has been created.
@@ -141,6 +144,34 @@
int render_process_id,
int render_view_id);
+ // Asks permission to show desktop notifications.
+ virtual void RequestDesktopNotificationPermission(
+ const GURL& source_origin,
+ int callback_context,
+ int render_process_id,
+ int render_view_id);
+
+ // Checks if the given page has permission to show desktop notifications.
+ // This is called on the IO thread.
+ virtual WebKit::WebNotificationPresenter::Permission
+ CheckDesktopNotificationPermission(
+ const GURL& source_url,
+ const content::ResourceContext& context);
+
+ // Show a desktop notification. If |worker| is true, the request came from an
+ // HTML5 web worker, otherwise, it came from a renderer.
+ virtual void ShowDesktopNotification(
+ const DesktopNotificationHostMsg_Show_Params& params,
+ int render_process_id,
+ int render_view_id,
+ bool worker);
+
+ // Cancels a displayed desktop notification.
+ virtual void CancelDesktopNotification(
+ int render_process_id,
+ int render_view_id,
+ int notification_id);
+
#if defined(OS_POSIX) && !defined(OS_MACOSX)
// Can return an optional fd for crash handling, otherwise returns -1.
virtual int GetCrashSignalFD(const std::string& process_type);

Powered by Google App Engine
This is Rietveld 408576698