| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <X11/Xlib.h> | 5 #include <X11/Xlib.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "blimp/client/blimp_startup.h" | 13 #include "blimp/client/blimp_startup.h" |
| 14 #include "blimp/client/session/blimp_client_session_linux.h" | 14 #include "blimp/client/session/blimp_client_session_linux.h" |
| 15 #include "blimp/client/session/navigation_feature.h" | 15 #include "blimp/client/session/navigation_feature.h" |
| 16 #include "blimp/client/session/tab_control_feature.h" | 16 #include "blimp/client/session/tab_control_feature.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 const char kDefaultUrl[] = "https://www.google.com"; | 19 const char kDefaultUrl[] = "https://www.google.com"; |
| 20 const int kDummyTabId = 0; | 20 const int kDummyTabId = 0; |
| 21 } | 21 } |
| 22 | 22 |
| 23 int main(int argc, const char**argv) { | 23 int main(int argc, const char**argv) { |
| 24 base::AtExitManager at_exit; | 24 base::AtExitManager at_exit; |
| 25 base::CommandLine::Init(argc, argv); | 25 base::CommandLine::Init(argc, argv); |
| 26 | 26 |
| 27 XInitThreads(); | 27 XInitThreads(); |
| 28 | 28 |
| 29 blimp::InitializeLogging(); | 29 blimp::client::InitializeLogging(); |
| 30 blimp::InitializeMainMessageLoop(); | 30 blimp::client::InitializeMainMessageLoop(); |
| 31 | 31 |
| 32 blimp::BlimpClientSessionLinux session; | 32 blimp::client::BlimpClientSessionLinux session; |
| 33 session.GetTabControlFeature()->CreateTab(kDummyTabId); | 33 session.GetTabControlFeature()->CreateTab(kDummyTabId); |
| 34 | 34 |
| 35 // If there is a non-switch argument to the command line, load that url. | 35 // If there is a non-switch argument to the command line, load that url. |
| 36 base::CommandLine::StringVector args = | 36 base::CommandLine::StringVector args = |
| 37 base::CommandLine::ForCurrentProcess()->GetArgs(); | 37 base::CommandLine::ForCurrentProcess()->GetArgs(); |
| 38 std::string url = args.size() > 0 ? args[0] : kDefaultUrl; | 38 std::string url = args.size() > 0 ? args[0] : kDefaultUrl; |
| 39 session.GetNavigationFeature()->NavigateToUrlText(kDummyTabId, url); | 39 session.GetNavigationFeature()->NavigateToUrlText(kDummyTabId, url); |
| 40 | 40 |
| 41 base::RunLoop().Run(); | 41 base::RunLoop().Run(); |
| 42 } | 42 } |
| OLD | NEW |