OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "content/shell/shell.h" | 9 #include "content/shell/shell.h" |
10 #include "content/shell/shell_browser_main.h" | 10 #include "content/shell/shell_browser_main.h" |
11 #include "content/shell/shell_devtools_delegate.h" | 11 #include "content/shell/shell_devtools_delegate.h" |
12 #include "content/shell/shell_render_view_host_observer.h" | 12 #include "content/shell/shell_render_view_host_observer.h" |
13 #include "content/shell/shell_switches.h" | 13 #include "content/shell/shell_switches.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
16 | 16 |
17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
18 #include "content/browser/tab_contents/tab_contents.h" | 18 #include "content/browser/tab_contents/tab_contents.h" |
19 #include "content/browser/tab_contents/tab_contents_view_win.h" | 19 #include "content/browser/tab_contents/tab_contents_view_win.h" |
20 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
21 #elif defined(OS_LINUX) | 21 #elif defined(OS_LINUX) |
22 #include "content/browser/tab_contents/tab_contents_view_gtk.h" | 22 #include "content/browser/tab_contents/tab_contents_view_gtk.h" |
| 23 #elif defined(OS_MACOSX) |
| 24 #include "content/browser/tab_contents/web_contents_view_mac.h" |
23 #endif | 25 #endif |
24 | 26 |
25 namespace content { | 27 namespace content { |
26 | 28 |
27 ShellContentBrowserClient::ShellContentBrowserClient() | 29 ShellContentBrowserClient::ShellContentBrowserClient() |
28 : shell_browser_main_parts_(NULL) { | 30 : shell_browser_main_parts_(NULL) { |
29 } | 31 } |
30 | 32 |
31 ShellContentBrowserClient::~ShellContentBrowserClient() { | 33 ShellContentBrowserClient::~ShellContentBrowserClient() { |
32 } | 34 } |
33 | 35 |
34 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( | 36 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( |
35 const content::MainFunctionParams& parameters) { | 37 const content::MainFunctionParams& parameters) { |
36 return new ShellBrowserMainParts(parameters); | 38 return new ShellBrowserMainParts(parameters); |
37 } | 39 } |
38 | 40 |
39 WebContentsView* ShellContentBrowserClient::CreateWebContentsView( | 41 WebContentsView* ShellContentBrowserClient::CreateWebContentsView( |
40 WebContents* web_contents) { | 42 WebContents* web_contents) { |
41 ShellDevToolsDelegate* devtools_delegate = | 43 ShellDevToolsDelegate* devtools_delegate = |
42 shell_browser_main_parts_->devtools_delegate(); | 44 shell_browser_main_parts_->devtools_delegate(); |
43 if (devtools_delegate) | 45 if (devtools_delegate) |
44 devtools_delegate->AddWebContents(web_contents); | 46 devtools_delegate->AddWebContents(web_contents); |
45 | 47 |
46 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
47 return new TabContentsViewWin(web_contents); | 49 return new TabContentsViewWin(web_contents); |
48 #elif defined(OS_LINUX) | 50 #elif defined(OS_LINUX) |
49 return new TabContentsViewGtk(web_contents, NULL); | 51 return new TabContentsViewGtk(web_contents, NULL); |
| 52 #elif defined(OS_MACOSX) |
| 53 return web_contents_view_mac::CreateWebContentsView(web_contents, NULL); |
50 #else | 54 #else |
51 return NULL; | 55 return NULL; |
52 #endif | 56 #endif |
53 } | 57 } |
54 | 58 |
55 void ShellContentBrowserClient::RenderViewHostCreated( | 59 void ShellContentBrowserClient::RenderViewHostCreated( |
56 RenderViewHost* render_view_host) { | 60 RenderViewHost* render_view_host) { |
57 new ShellRenderViewHostObserver(render_view_host); | 61 new ShellRenderViewHostObserver(render_view_host); |
58 } | 62 } |
59 | 63 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 #endif | 352 #endif |
349 | 353 |
350 #if defined(USE_NSS) | 354 #if defined(USE_NSS) |
351 crypto::CryptoModuleBlockingPasswordDelegate* | 355 crypto::CryptoModuleBlockingPasswordDelegate* |
352 ShellContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { | 356 ShellContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { |
353 return NULL; | 357 return NULL; |
354 } | 358 } |
355 #endif | 359 #endif |
356 | 360 |
357 } // namespace content | 361 } // namespace content |
OLD | NEW |