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

Unified Diff: blimp/client/linux/blimp_main.cc

Issue 1528243002: Add a basic linux client for Blimp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: X11, how does it work? Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/linux/blimp_main.cc
diff --git a/blimp/client/linux/blimp_main.cc b/blimp/client/linux/blimp_main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7167ea5a38bb79c5f349b67a8b66f8011ad04bc0
--- /dev/null
+++ b/blimp/client/linux/blimp_main.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/run_loop.h"
+#include "blimp/client/blimp_startup.h"
+#include "blimp/client/session/blimp_client_session_linux.h"
+#include "blimp/client/session/navigation_feature.h"
+
+#include <X11/Xlib.h>
+
+namespace {
+const char kDefaultUrl[] = "https://www.google.com";
+const int kDummyTabId = 0;
+}
+
+int main(int argc, const char**argv) {
+ base::AtExitManager at_exit;
+
+ base::CommandLine::Init(argc, argv);
+
+ XInitThreads();
+
+ blimp::InitializeLogging();
+ blimp::InitializeMainMessageLoop();
+
+ blimp::BlimpClientSessionLinux session;
+
+ // If there is a non-switch argument to the command line, load that url.
+ base::CommandLine::StringVector args =
+ base::CommandLine::ForCurrentProcess()->GetArgs();
+ std::string url = args.size() > 0 ? args[0] : kDefaultUrl;
+
+ session.GetNavigationFeature()->NavigateToUrlText(kDummyTabId, url);
+
+ base::RunLoop().Run();
+}

Powered by Google App Engine
This is Rietveld 408576698