diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 05:23:02 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 05:23:02 +0000 |
commit | 882af65180d11dc7b799d1bb361f8362d7639426 (patch) | |
tree | 9d6355398e2a66cd126a2a1a786f7a6378d027dd /athena | |
parent | 846543597405c95ecfcc3318e1c071f5f9a2b1f1 (diff) | |
download | chromium_src-882af65180d11dc7b799d1bb361f8362d7639426.zip chromium_src-882af65180d11dc7b799d1bb361f8362d7639426.tar.gz chromium_src-882af65180d11dc7b799d1bb361f8362d7639426.tar.bz2 |
athena: Add a minimal executable for just the UI.
athena_ui_main is a small executable that creates an aura host window
and builds the athena UI on it. This should make it easier to play with
the UI (a la ash_shell etc.)
BUG=362288
R=oshima@chromium.org
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/302473005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273718 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'athena')
-rw-r--r-- | athena/main/DEPS | 5 | ||||
-rw-r--r-- | athena/main/athena_main.gyp | 18 | ||||
-rw-r--r-- | athena/main/athena_shell.cc | 44 |
3 files changed, 67 insertions, 0 deletions
diff --git a/athena/main/DEPS b/athena/main/DEPS index e2789a5..2d53fb1 100644 --- a/athena/main/DEPS +++ b/athena/main/DEPS @@ -3,6 +3,8 @@ include_rules = [ "+athena/screen/public", "+athena/wm/public", "+ui/aura", + "+ui/compositor", + "+ui/gl", "+ui/wm/core", ] @@ -12,6 +14,9 @@ specific_include_rules = { "+apps/shell/browser", "+content/public/app", ], + "athena_shell\.cc": [ + "+athena/test", + ], # TODO(oshima): Remove this. "placeholder\.*": [ "+third_party/skia", diff --git a/athena/main/athena_main.gyp b/athena/main/athena_main.gyp index 480f40c..c21fa111 100644 --- a/athena/main/athena_main.gyp +++ b/athena/main/athena_main.gyp @@ -28,5 +28,23 @@ 'placeholder.h', ], }, + { + 'target_name': 'athena_shell', + 'type': 'executable', + 'dependencies': [ + '../../base/base.gyp:base', + '../../base/base.gyp:base_i18n', + '../../skia/skia.gyp:skia', + '../../ui/accessibility/accessibility.gyp:ax_gen', + '../../ui/aura/aura.gyp:aura', + '../../ui/compositor/compositor.gyp:compositor_test_support', + '../../ui/gfx/gfx.gyp:gfx', + '../athena.gyp:athena_lib', + '../athena.gyp:athena_test_support', + ], + 'sources': [ + 'athena_shell.cc', + ], + } ], # targets } diff --git a/athena/main/athena_shell.cc b/athena/main/athena_shell.cc new file mode 100644 index 0000000..3a1ef1d --- /dev/null +++ b/athena/main/athena_shell.cc @@ -0,0 +1,44 @@ +// Copyright 2014 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 "athena/test/athena_test_helper.h" +#include "base/at_exit.h" +#include "base/command_line.h" +#include "base/i18n/icu_util.h" +#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#include "ui/aura/window_tree_host.h" +#include "ui/compositor/test/context_factories_for_test.h" +#include "ui/gl/gl_surface.h" + +class UIShell { + public: + explicit UIShell(base::MessageLoopForUI* message_loop) + : athena_helper_(message_loop) { + const bool enable_pixel_output = true; + ui::ContextFactory* factory = + ui::InitializeContextFactoryForTests(enable_pixel_output); + athena_helper_.SetUp(factory); + athena_helper_.host()->Show(); + } + + private: + athena::test::AthenaTestHelper athena_helper_; + + DISALLOW_COPY_AND_ASSIGN(UIShell); +}; + +int main(int argc, const char **argv) { + setlocale(LC_ALL, ""); + + base::AtExitManager exit_manager; + base::CommandLine::Init(argc, argv); + base::i18n::InitializeICU(); + gfx::GLSurface::InitializeOneOffForTests(); + + base::MessageLoopForUI message_loop; + UIShell shell(&message_loop); + base::RunLoop run_loop; + run_loop.Run(); +} |