| 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_browser_main.h" | 5 #include "content/shell/shell_browser_main.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "content/browser/browser_process_sub_thread.h" | 10 #include "content/browser/browser_process_sub_thread.h" |
| 11 #include "content/browser/download/download_file_manager.h" | 11 #include "content/browser/download/download_file_manager.h" |
| 12 #include "content/browser/download/save_file_manager.h" | 12 #include "content/browser/download/save_file_manager.h" |
| 13 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 13 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 14 #include "content/shell/shell.h" | 14 #include "content/shell/shell.h" |
| 15 #include "content/shell/shell_browser_context.h" | 15 #include "content/shell/shell_browser_context.h" |
| 16 #include "content/shell/shell_content_browser_client.h" | 16 #include "content/shell/shell_content_browser_client.h" |
| 17 #include "net/base/net_module.h" | 17 #include "net/base/net_module.h" |
| 18 #include "ui/base/clipboard/clipboard.h" | 18 #include "ui/base/clipboard/clipboard.h" |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 ShellBrowserMainParts::ShellBrowserMainParts( | 22 ShellBrowserMainParts::ShellBrowserMainParts( |
| 23 const MainFunctionParams& parameters) | 23 const MainFunctionParams& parameters) |
| 24 : BrowserMainParts(parameters) { | 24 : BrowserMainParts() { |
| 25 ShellContentBrowserClient* shell_browser_client = | 25 ShellContentBrowserClient* shell_browser_client = |
| 26 static_cast<ShellContentBrowserClient*>( | 26 static_cast<ShellContentBrowserClient*>( |
| 27 content::GetContentClient()->browser()); | 27 content::GetContentClient()->browser()); |
| 28 shell_browser_client->set_shell_browser_main_parts(this); | 28 shell_browser_client->set_shell_browser_main_parts(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 ShellBrowserMainParts::~ShellBrowserMainParts() { | 31 ShellBrowserMainParts::~ShellBrowserMainParts() { |
| 32 base::ThreadRestrictions::SetIOAllowed(true); | 32 base::ThreadRestrictions::SetIOAllowed(true); |
| 33 io_thread()->message_loop()->PostTask( | 33 io_thread()->message_loop()->PostTask( |
| 34 FROM_HERE, | 34 FROM_HERE, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 browser_context_.reset(new ShellBrowserContext(this)); | 67 browser_context_.reset(new ShellBrowserContext(this)); |
| 68 | 68 |
| 69 Shell::PlatformInitialize(); | 69 Shell::PlatformInitialize(); |
| 70 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); | 70 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); |
| 71 | 71 |
| 72 Shell::CreateNewWindow(browser_context_.get(), | 72 Shell::CreateNewWindow(browser_context_.get(), |
| 73 GURL("http://www.google.com"), | 73 GURL("http://www.google.com"), |
| 74 NULL, | 74 NULL, |
| 75 MSG_ROUTING_NONE, | 75 MSG_ROUTING_NONE, |
| 76 NULL); | 76 NULL); |
| 77 |
| 78 } |
| 79 |
| 80 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 81 return false; |
| 77 } | 82 } |
| 78 | 83 |
| 79 ResourceDispatcherHost* ShellBrowserMainParts::GetResourceDispatcherHost() { | 84 ResourceDispatcherHost* ShellBrowserMainParts::GetResourceDispatcherHost() { |
| 80 if (!resource_dispatcher_host_.get()) { | 85 if (!resource_dispatcher_host_.get()) { |
| 81 ResourceQueue::DelegateSet resource_queue_delegates; | 86 ResourceQueue::DelegateSet resource_queue_delegates; |
| 82 resource_dispatcher_host_.reset( | 87 resource_dispatcher_host_.reset( |
| 83 new ResourceDispatcherHost(resource_queue_delegates)); | 88 new ResourceDispatcherHost(resource_queue_delegates)); |
| 84 resource_dispatcher_host_->Initialize(); | 89 resource_dispatcher_host_->Initialize(); |
| 85 } | 90 } |
| 86 return resource_dispatcher_host_.get(); | 91 return resource_dispatcher_host_.get(); |
| 87 } | 92 } |
| 88 | 93 |
| 89 ui::Clipboard* ShellBrowserMainParts::GetClipboard() { | 94 ui::Clipboard* ShellBrowserMainParts::GetClipboard() { |
| 90 if (!clipboard_.get()) | 95 if (!clipboard_.get()) |
| 91 clipboard_.reset(new ui::Clipboard()); | 96 clipboard_.reset(new ui::Clipboard()); |
| 92 return clipboard_.get(); | 97 return clipboard_.get(); |
| 93 } | 98 } |
| 94 | 99 |
| 95 } // namespace | 100 } // namespace |
| OLD | NEW |