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..ef66e8f8dd11fdf36dc2900aa6af17296aa8f23f 100644 |
--- a/blimp/engine/browser/blimp_browser_main_parts.cc |
+++ b/blimp/engine/browser/blimp_browser_main_parts.cc |
@@ -4,36 +4,20 @@ |
#include "blimp/engine/browser/blimp_browser_main_parts.h" |
-#include "base/command_line.h" |
-#include "blimp/engine/browser/blimp_window.h" |
+#include "blimp/engine/browser/blimp_browser_context.h" |
+#include "blimp/engine/browser/blimp_client_session_manager.h" |
+#include "blimp/engine/browser/blimp_client_session_manager_delegate.h" |
Kevin M
2015/10/14 17:52:56
Not used
haibinlu
2015/10/15 01:59:27
Done.
|
+#include "blimp/engine/browser/blimp_engine_session.h" |
#include "blimp/engine/ui/blimp_screen.h" |
#include "content/public/browser/browser_thread.h" |
#include "net/base/net_module.h" |
#include "net/log/net_log.h" |
-#include "url/gurl.h" |
+ |
+#include "ui/base/ime/input_method_initializer.h" |
Kevin M
2015/10/14 17:52:56
Not used
haibinlu
2015/10/15 01:59:27
Done.
|
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 +25,24 @@ 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())); |
+ client_session_manager_.reset( |
+ new BlimpClientSessionManager(engine_session_.get(), net_log_.get())); |
+ engine_session_->Initialize(); |
+ // TODO(haibinlu): remove this after a real client session can be attached. |
+ client_session_manager_->AttachTestClientSession(); |
} |
-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() { |
+ client_session_manager_.reset(); |
+ engine_session_.reset(); |
Kevin M
2015/10/14 17:52:56
Is this necessary? These will be destroyed automat
haibinlu
2015/10/15 01:59:27
per offline discussion, it's for cleaning up objec
|
} |
-void BlimpBrowserMainParts::PostMainMessageLoopRun() { |
- browser_context_.reset(); |
+BlimpBrowserContext* BlimpBrowserMainParts::browser_context() { |
+ DCHECK(engine_session_); |
Kevin M
2015/10/14 17:52:56
This can be kept as a simple getter - the dcheck i
haibinlu
2015/10/15 01:59:27
Done.
|
+ return engine_session_->browser_context(); |
} |
} // namespace engine |