Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: blimp/client/app/linux/blimp_main.cc

Issue 1826073002: Remove dependency of Blimp on X11/Xlib.h header to avoid namespace polution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add check Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
6
7 #include <string> 5 #include <string>
8 6
9 #include "base/at_exit.h" 7 #include "base/at_exit.h"
10 #include "base/command_line.h" 8 #include "base/command_line.h"
11 #include "base/run_loop.h" 9 #include "base/run_loop.h"
12 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
13 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
14 #include "blimp/client/app/blimp_startup.h" 12 #include "blimp/client/app/blimp_startup.h"
15 #include "blimp/client/app/linux/blimp_client_session_linux.h" 13 #include "blimp/client/app/linux/blimp_client_session_linux.h"
16 #include "blimp/client/feature/navigation_feature.h" 14 #include "blimp/client/feature/navigation_feature.h"
17 #include "blimp/client/feature/tab_control_feature.h" 15 #include "blimp/client/feature/tab_control_feature.h"
18 #include "blimp/client/session/assignment_source.h" 16 #include "blimp/client/session/assignment_source.h"
17 #include "ui/gfx/x/x11_connection.h"
19 18
20 namespace { 19 namespace {
21 const char kDummyLoginToken[] = ""; 20 const char kDummyLoginToken[] = "";
22 const char kDefaultUrl[] = "https://www.google.com"; 21 const char kDefaultUrl[] = "https://www.google.com";
23 const int kDummyTabId = 0; 22 const int kDummyTabId = 0;
24 } 23 }
25 24
26 int main(int argc, const char**argv) { 25 int main(int argc, const char**argv) {
27 base::AtExitManager at_exit; 26 base::AtExitManager at_exit;
28 base::CommandLine::Init(argc, argv); 27 base::CommandLine::Init(argc, argv);
29 28
30 XInitThreads(); 29 CHECK(gfx::InitializeThreadedX11());
31 30
32 blimp::client::InitializeLogging(); 31 blimp::client::InitializeLogging();
33 blimp::client::InitializeMainMessageLoop(); 32 blimp::client::InitializeMainMessageLoop();
34 33
35 blimp::client::BlimpClientSessionLinux session; 34 blimp::client::BlimpClientSessionLinux session;
36 session.GetTabControlFeature()->CreateTab(kDummyTabId); 35 session.GetTabControlFeature()->CreateTab(kDummyTabId);
37 session.Connect(kDummyLoginToken); 36 session.Connect(kDummyLoginToken);
38 37
39 // If there is a non-switch argument to the command line, load that url. 38 // If there is a non-switch argument to the command line, load that url.
40 base::CommandLine::StringVector args = 39 base::CommandLine::StringVector args =
41 base::CommandLine::ForCurrentProcess()->GetArgs(); 40 base::CommandLine::ForCurrentProcess()->GetArgs();
42 std::string url = args.size() > 0 ? args[0] : kDefaultUrl; 41 std::string url = args.size() > 0 ? args[0] : kDefaultUrl;
43 session.GetNavigationFeature()->NavigateToUrlText(kDummyTabId, url); 42 session.GetNavigationFeature()->NavigateToUrlText(kDummyTabId, url);
44 43
45 base::RunLoop().Run(); 44 base::RunLoop().Run();
46 } 45 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698