| Index: blimp/engine/browser/blimp_browser_main_parts.cc
|
| diff --git a/blimp/engine/browser/blimp_browser_main_parts.cc b/blimp/engine/browser/blimp_browser_main_parts.cc
|
| index a1c04742e9d751f02e5e33c299ac84b8678091d6..aaba2d353b1c357f7f39b4d823162132144b6c51 100644
|
| --- a/blimp/engine/browser/blimp_browser_main_parts.cc
|
| +++ b/blimp/engine/browser/blimp_browser_main_parts.cc
|
| @@ -4,36 +4,17 @@
|
|
|
| #include "blimp/engine/browser/blimp_browser_main_parts.h"
|
|
|
| -#include "base/command_line.h"
|
| -#include "blimp/engine/browser/blimp_window.h"
|
| -#include "blimp/engine/ui/blimp_screen.h"
|
| +#include "blimp/engine/browser/blimp_browser_context.h"
|
| +#include "blimp/engine/browser/blimp_engine_session.h"
|
| +#include "blimp/net/blimp_client_session.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/common/main_function_params.h"
|
| #include "net/base/net_module.h"
|
| #include "net/log/net_log.h"
|
| -#include "url/gurl.h"
|
|
|
| namespace blimp {
|
| namespace engine {
|
|
|
| -namespace {
|
| -
|
| -const char kDefaultURL[] = "https://www.google.com/";
|
| -
|
| -GURL GetStartupURL() {
|
| - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| - const base::CommandLine::StringVector& args = command_line->GetArgs();
|
| - if (args.empty())
|
| - return GURL(kDefaultURL);
|
| -
|
| - GURL url(args[0]);
|
| - if (url.is_valid() && url.has_scheme())
|
| - return url;
|
| -
|
| - return GURL(kDefaultURL);
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| BlimpBrowserMainParts::BlimpBrowserMainParts(
|
| const content::MainFunctionParams& parameters) {}
|
|
|
| @@ -41,20 +22,21 @@ BlimpBrowserMainParts::~BlimpBrowserMainParts() {}
|
|
|
| void BlimpBrowserMainParts::PreMainMessageLoopRun() {
|
| net_log_.reset(new net::NetLog());
|
| - browser_context_.reset(new BlimpBrowserContext(false, net_log_.get()));
|
| - BlimpWindow::Create(browser_context_.get(), GetStartupURL(), nullptr,
|
| - gfx::Size());
|
| + scoped_ptr<BlimpBrowserContext> browser_context(
|
| + new BlimpBrowserContext(false, net_log_.get()));
|
| + engine_session_.reset(new BlimpEngineSession(browser_context.Pass()));
|
| + engine_session_->Initialize();
|
| + // TODO(haibinlu): remove this after a real client session can be attached.
|
| + scoped_ptr<BlimpClientSession> startupSession(new BlimpClientSession);
|
| + engine_session_->AttachClientSession(startupSession.Pass());
|
| }
|
|
|
| -int BlimpBrowserMainParts::PreCreateThreads() {
|
| - screen_.reset(new BlimpScreen);
|
| - DCHECK(!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE));
|
| - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
|
| - return 0;
|
| +void BlimpBrowserMainParts::PostMainMessageLoopRun() {
|
| + engine_session_.reset();
|
| }
|
|
|
| -void BlimpBrowserMainParts::PostMainMessageLoopRun() {
|
| - browser_context_.reset();
|
| +BlimpBrowserContext* BlimpBrowserMainParts::GetBrowserContext() {
|
| + return engine_session_->browser_context();
|
| }
|
|
|
| } // namespace engine
|
|
|