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