OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
6 #define CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_old.h" | 11 #include "base/callback_old.h" |
12 #include "content/common/content_client.h" | 12 #include "content/common/content_client.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
13 | 14 |
14 class BrowserRenderProcessHost; | 15 class BrowserRenderProcessHost; |
15 class CommandLine; | 16 class CommandLine; |
16 class FilePath; | 17 class FilePath; |
17 class GURL; | 18 class GURL; |
18 class PluginProcessHost; | 19 class PluginProcessHost; |
19 class Profile; | 20 class Profile; |
20 class QuotaPermissionContext; | 21 class QuotaPermissionContext; |
21 class RenderViewHost; | 22 class RenderViewHost; |
22 class SSLCertErrorHandler; | 23 class SSLCertErrorHandler; |
23 class SSLClientAuthHandler; | 24 class SSLClientAuthHandler; |
24 class TabContents; | 25 class TabContents; |
25 class WorkerProcessHost; | 26 class WorkerProcessHost; |
| 27 struct DesktopNotificationHostMsg_Show_Params; |
26 | 28 |
27 namespace net { | 29 namespace net { |
28 class CookieList; | 30 class CookieList; |
29 class CookieOptions; | 31 class CookieOptions; |
30 class URLRequest; | 32 class URLRequest; |
31 class X509Certificate; | 33 class X509Certificate; |
32 } | 34 } |
33 | 35 |
34 namespace content { | 36 namespace content { |
35 | 37 |
36 class ResourceContext; | 38 class ResourceContext; |
37 class WebUIFactory; | 39 class WebUIFactory; |
38 | 40 |
39 // Embedder API for participating in browser logic. | 41 // Embedder API for participating in browser logic. The methods are assumed to |
| 42 // be called on the UI thread unless otherwise specified. |
40 class ContentBrowserClient { | 43 class ContentBrowserClient { |
41 public: | 44 public: |
42 // Notifies that a new RenderHostView has been created. | 45 // Notifies that a new RenderHostView has been created. |
43 virtual void RenderViewHostCreated(RenderViewHost* render_view_host); | 46 virtual void RenderViewHostCreated(RenderViewHost* render_view_host); |
44 | 47 |
45 // Notifies that a BrowserRenderProcessHost has been created. This is called | 48 // Notifies that a BrowserRenderProcessHost has been created. This is called |
46 // before the content layer adds its own BrowserMessageFilters, so that the | 49 // before the content layer adds its own BrowserMessageFilters, so that the |
47 // embedder's IPC filters have priority. | 50 // embedder's IPC filters have priority. |
48 virtual void BrowserRenderProcessHostCreated(BrowserRenderProcessHost* host); | 51 virtual void BrowserRenderProcessHostCreated(BrowserRenderProcessHost* host); |
49 | 52 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 137 |
135 // Adds a newly-generated client cert. The embedder should ensure that there's | 138 // Adds a newly-generated client cert. The embedder should ensure that there's |
136 // a private key for the cert, displays the cert to the user, and adds it upon | 139 // a private key for the cert, displays the cert to the user, and adds it upon |
137 // user approval. | 140 // user approval. |
138 virtual void AddNewCertificate( | 141 virtual void AddNewCertificate( |
139 net::URLRequest* request, | 142 net::URLRequest* request, |
140 net::X509Certificate* cert, | 143 net::X509Certificate* cert, |
141 int render_process_id, | 144 int render_process_id, |
142 int render_view_id); | 145 int render_view_id); |
143 | 146 |
| 147 // Asks permission to show desktop notifications. |
| 148 virtual void RequestDesktopNotificationPermission( |
| 149 const GURL& source_origin, |
| 150 int callback_context, |
| 151 int render_process_id, |
| 152 int render_view_id); |
| 153 |
| 154 // Checks if the given page has permission to show desktop notifications. |
| 155 // This is called on the IO thread. |
| 156 virtual WebKit::WebNotificationPresenter::Permission |
| 157 CheckDesktopNotificationPermission( |
| 158 const GURL& source_url, |
| 159 const content::ResourceContext& context); |
| 160 |
| 161 // Show a desktop notification. If |worker| is true, the request came from an |
| 162 // HTML5 web worker, otherwise, it came from a renderer. |
| 163 virtual void ShowDesktopNotification( |
| 164 const DesktopNotificationHostMsg_Show_Params& params, |
| 165 int render_process_id, |
| 166 int render_view_id, |
| 167 bool worker); |
| 168 |
| 169 // Cancels a displayed desktop notification. |
| 170 virtual void CancelDesktopNotification( |
| 171 int render_process_id, |
| 172 int render_view_id, |
| 173 int notification_id); |
| 174 |
144 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 175 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
145 // Can return an optional fd for crash handling, otherwise returns -1. | 176 // Can return an optional fd for crash handling, otherwise returns -1. |
146 virtual int GetCrashSignalFD(const std::string& process_type); | 177 virtual int GetCrashSignalFD(const std::string& process_type); |
147 #endif | 178 #endif |
148 }; | 179 }; |
149 | 180 |
150 } // namespace content | 181 } // namespace content |
151 | 182 |
152 #endif // CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 183 #endif // CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |