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/string16.h" | |
11 #include "content/common/content_client.h" | 12 #include "content/common/content_client.h" |
12 | 13 |
13 class BrowserRenderProcessHost; | 14 class BrowserRenderProcessHost; |
14 class CommandLine; | 15 class CommandLine; |
15 class FilePath; | 16 class FilePath; |
16 class GURL; | 17 class GURL; |
17 class PluginProcessHost; | 18 class PluginProcessHost; |
18 class Profile; | 19 class Profile; |
19 class QuotaPermissionContext; | 20 class QuotaPermissionContext; |
20 class RenderViewHost; | 21 class RenderViewHost; |
21 class TabContents; | 22 class TabContents; |
22 class WorkerProcessHost; | 23 class WorkerProcessHost; |
23 | 24 |
24 namespace net { | 25 namespace net { |
25 class CookieList; | 26 class CookieList; |
26 class CookieOptions; | 27 class CookieOptions; |
27 } | 28 } |
28 | 29 |
29 namespace content { | 30 namespace content { |
30 | 31 |
32 class JavaScriptDialogDelegate; | |
31 class ResourceContext; | 33 class ResourceContext; |
32 class WebUIFactory; | 34 class WebUIFactory; |
33 | 35 |
34 // Embedder API for participating in browser logic. | 36 // Embedder API for participating in browser logic. |
35 class ContentBrowserClient { | 37 class ContentBrowserClient { |
36 public: | 38 public: |
37 // Notifies that a new RenderHostView has been created. | 39 // Notifies that a new RenderHostView has been created. |
38 virtual void RenderViewHostCreated(RenderViewHost* render_view_host); | 40 virtual void RenderViewHostCreated(RenderViewHost* render_view_host); |
39 | 41 |
40 // Notifies that a BrowserRenderProcessHost has been created. This is called | 42 // Notifies that a BrowserRenderProcessHost has been created. This is called |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 int render_process_id, | 104 int render_process_id, |
103 int render_view_id, | 105 int render_view_id, |
104 net::CookieOptions* options); | 106 net::CookieOptions* options); |
105 | 107 |
106 // Create and return a new quota permission context. | 108 // Create and return a new quota permission context. |
107 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); | 109 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); |
108 | 110 |
109 // Shows the given path using the OS file manager. | 111 // Shows the given path using the OS file manager. |
110 virtual void RevealFolderInOS(const FilePath& path); | 112 virtual void RevealFolderInOS(const FilePath& path); |
111 | 113 |
114 // Allow the embedder to display a JavaScript dialog. |did_suppress_message| | |
115 // will not be nil; if |true| is returned in it, the caller will handle faking | |
116 // the reply. TODO(avi): Remove Profile from this call; http://crbug.com/84601 | |
117 virtual void RunJavaScriptDialog(JavaScriptDialogDelegate* delegate, | |
jam
2011/06/01 19:20:08
i tend to think of ContentBrowserClient as a last-
Avi (use Gerrit)
2011/06/01 19:40:34
Lemme poke at that.
| |
118 const GURL& frame_url, | |
119 int dialog_flags, | |
120 const string16& message_text, | |
121 const string16& default_prompt_text, | |
122 IPC::Message* reply_message, | |
123 bool* did_suppress_message, | |
124 Profile* profile); | |
125 | |
126 // Allow the embedder to display a dialog asking the user if they want to | |
127 // leave a page. The users response is returned to the renderer using | |
128 // |reply_msg|. | |
129 virtual void RunBeforeUnloadDialog(JavaScriptDialogDelegate* delegate, | |
130 const string16& message_text, | |
131 IPC::Message* reply_msg); | |
132 | |
133 // Resets any saved JavaScript dialog state for the delegate. | |
134 virtual void ResetJavaScriptState(JavaScriptDialogDelegate* delegate); | |
135 | |
112 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 136 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
113 // Can return an optional fd for crash handling, otherwise returns -1. | 137 // Can return an optional fd for crash handling, otherwise returns -1. |
114 virtual int GetCrashSignalFD(const std::string& process_type); | 138 virtual int GetCrashSignalFD(const std::string& process_type); |
115 #endif | 139 #endif |
116 }; | 140 }; |
117 | 141 |
118 } // namespace content | 142 } // namespace content |
119 | 143 |
120 #endif // CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 144 #endif // CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |