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 #include "content/shell/shell_content_browser_client.h" | 5 #include "content/shell/shell_content_browser_client.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "content/browser/webui/empty_web_ui_factory.h" | 8 #include "content/browser/webui/empty_web_ui_factory.h" |
| 9 #include "content/shell/shell_browser_main.h" |
9 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
11 #include "ui/base/clipboard/clipboard.h" | |
12 #include "webkit/glue/webpreferences.h" | 12 #include "webkit/glue/webpreferences.h" |
13 | 13 |
| 14 #if defined(OS_WIN) |
| 15 #include "content/browser/tab_contents/tab_contents_view_win.h" |
| 16 #endif |
| 17 |
14 namespace content { | 18 namespace content { |
15 | 19 |
| 20 ShellContentBrowserClient::ShellContentBrowserClient() |
| 21 : shell_browser_main_parts_(NULL) { |
| 22 } |
| 23 |
16 ShellContentBrowserClient::~ShellContentBrowserClient() { | 24 ShellContentBrowserClient::~ShellContentBrowserClient() { |
17 } | 25 } |
18 | 26 |
19 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( | 27 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( |
20 const MainFunctionParams& parameters) { | 28 const MainFunctionParams& parameters) { |
21 return NULL; | 29 return new ShellBrowserMainParts(parameters); |
22 } | 30 } |
23 | 31 |
24 TabContentsView* ShellContentBrowserClient::CreateTabContentsView( | 32 TabContentsView* ShellContentBrowserClient::CreateTabContentsView( |
25 TabContents* tab_contents) { | 33 TabContents* tab_contents) { |
| 34 #if defined(TOOLKIT_VIEWS) |
| 35 return new TabContentsViewWin(tab_contents); |
| 36 #else |
26 return NULL; | 37 return NULL; |
| 38 #endif |
27 } | 39 } |
28 | 40 |
29 void ShellContentBrowserClient::RenderViewHostCreated( | 41 void ShellContentBrowserClient::RenderViewHostCreated( |
30 RenderViewHost* render_view_host) { | 42 RenderViewHost* render_view_host) { |
31 } | 43 } |
32 | 44 |
33 void ShellContentBrowserClient::BrowserRenderProcessHostCreated( | 45 void ShellContentBrowserClient::BrowserRenderProcessHostCreated( |
34 BrowserRenderProcessHost* host) { | 46 BrowserRenderProcessHost* host) { |
35 } | 47 } |
36 | 48 |
37 void ShellContentBrowserClient::PluginProcessHostCreated( | 49 void ShellContentBrowserClient::PluginProcessHostCreated( |
38 PluginProcessHost* host) { | 50 PluginProcessHost* host) { |
39 } | 51 } |
40 | 52 |
41 void ShellContentBrowserClient::WorkerProcessHostCreated( | 53 void ShellContentBrowserClient::WorkerProcessHostCreated( |
42 WorkerProcessHost* host) { | 54 WorkerProcessHost* host) { |
43 } | 55 } |
44 | 56 |
45 WebUIFactory* ShellContentBrowserClient::GetWebUIFactory() { | 57 WebUIFactory* ShellContentBrowserClient::GetWebUIFactory() { |
46 // Return an empty factory so callsites don't have to check for NULL. | 58 // Return an empty factory so callsites don't have to check for NULL. |
47 return EmptyWebUIFactory::Get(); | 59 return EmptyWebUIFactory::GetInstance(); |
48 } | 60 } |
49 | 61 |
50 GURL ShellContentBrowserClient::GetEffectiveURL( | 62 GURL ShellContentBrowserClient::GetEffectiveURL( |
51 content::BrowserContext* browser_context, const GURL& url) { | 63 content::BrowserContext* browser_context, const GURL& url) { |
52 return GURL(); | 64 return GURL(); |
53 } | 65 } |
54 | 66 |
55 bool ShellContentBrowserClient::ShouldUseProcessPerSite( | 67 bool ShellContentBrowserClient::ShouldUseProcessPerSite( |
56 BrowserContext* browser_context, const GURL& effective_url) { | 68 BrowserContext* browser_context, const GURL& effective_url) { |
57 return false; | 69 return false; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 const content::ResourceContext& context) { | 196 const content::ResourceContext& context) { |
185 return false; | 197 return false; |
186 } | 198 } |
187 | 199 |
188 std::string ShellContentBrowserClient::GetWorkerProcessTitle( | 200 std::string ShellContentBrowserClient::GetWorkerProcessTitle( |
189 const GURL& url, const content::ResourceContext& context) { | 201 const GURL& url, const content::ResourceContext& context) { |
190 return std::string(); | 202 return std::string(); |
191 } | 203 } |
192 | 204 |
193 ResourceDispatcherHost* ShellContentBrowserClient::GetResourceDispatcherHost() { | 205 ResourceDispatcherHost* ShellContentBrowserClient::GetResourceDispatcherHost() { |
194 return NULL; | 206 return shell_browser_main_parts_->GetResourceDispatcherHost(); |
195 } | 207 } |
196 | 208 |
197 ui::Clipboard* ShellContentBrowserClient::GetClipboard() { | 209 ui::Clipboard* ShellContentBrowserClient::GetClipboard() { |
198 static ui::Clipboard clipboard; | 210 return shell_browser_main_parts_->GetClipboard(); |
199 return &clipboard; | |
200 } | 211 } |
201 | 212 |
202 MHTMLGenerationManager* ShellContentBrowserClient::GetMHTMLGenerationManager() { | 213 MHTMLGenerationManager* ShellContentBrowserClient::GetMHTMLGenerationManager() { |
203 return NULL; | 214 return NULL; |
204 } | 215 } |
205 | 216 |
206 DevToolsManager* ShellContentBrowserClient::GetDevToolsManager() { | 217 DevToolsManager* ShellContentBrowserClient::GetDevToolsManager() { |
207 return NULL; | 218 return NULL; |
208 } | 219 } |
209 | 220 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 #endif | 286 #endif |
276 | 287 |
277 #if defined(USE_NSS) | 288 #if defined(USE_NSS) |
278 crypto::CryptoModuleBlockingPasswordDelegate* | 289 crypto::CryptoModuleBlockingPasswordDelegate* |
279 ShellContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { | 290 ShellContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { |
280 return NULL; | 291 return NULL; |
281 } | 292 } |
282 #endif | 293 #endif |
283 | 294 |
284 } // namespace content | 295 } // namespace content |
OLD | NEW |