Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/activity/public/activity_factory.h" | |
| 5 #include "athena/activity/public/activity_manager.h" | 6 #include "athena/activity/public/activity_manager.h" |
| 6 #include "athena/main/sample_activity.h" | |
| 7 #include "athena/test/athena_test_helper.h" | 7 #include "athena/test/athena_test_helper.h" |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
|
oshima
2014/06/05 23:50:53
can you remove this and also update main/DEPS?
Jun Mukai
2014/06/06 00:14:43
Done.
| |
| 15 #include "ui/aura/window_tree_host.h" | 15 #include "ui/aura/window_tree_host.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/base/ui_base_paths.h" | 17 #include "ui/base/ui_base_paths.h" |
| 18 #include "ui/compositor/test/context_factories_for_test.h" | 18 #include "ui/compositor/test/context_factories_for_test.h" |
| 19 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 20 | 20 |
| 21 class UIShell { | 21 class UIShell { |
| 22 public: | 22 public: |
| 23 explicit UIShell(base::MessageLoopForUI* message_loop) | 23 explicit UIShell(base::MessageLoopForUI* message_loop) |
| 24 : athena_helper_(message_loop) { | 24 : athena_helper_(message_loop) { |
| 25 const bool enable_pixel_output = true; | 25 const bool enable_pixel_output = true; |
| 26 ui::ContextFactory* factory = | 26 ui::ContextFactory* factory = |
| 27 ui::InitializeContextFactoryForTests(enable_pixel_output); | 27 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 28 athena_helper_.SetUp(factory); | 28 athena_helper_.SetUp(factory); |
| 29 athena_helper_.host()->Show(); | 29 athena_helper_.host()->Show(); |
| 30 | 30 |
| 31 InitSampleActivities(); | 31 InitSampleActivities(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void InitSampleActivities() { | 34 void InitSampleActivities() { |
| 35 athena::Activity* task = new SampleActivity( | 35 athena::ActivityManager::Get()->AddActivity( |
| 36 SK_ColorRED, SK_ColorGREEN, std::string("Activity 1")); | 36 athena::ActivityFactory::Get()->CreateWebActivity(NULL, GURL())); |
|
oshima
2014/06/05 23:49:20
maybe put real url and show it as a title?
Jun Mukai
2014/06/06 00:14:43
Done.
| |
| 37 athena::ActivityManager::Get()->AddActivity(task); | |
| 38 } | 37 } |
| 39 | 38 |
| 40 private: | 39 private: |
| 41 athena::test::AthenaTestHelper athena_helper_; | 40 athena::test::AthenaTestHelper athena_helper_; |
| 42 | 41 |
| 43 DISALLOW_COPY_AND_ASSIGN(UIShell); | 42 DISALLOW_COPY_AND_ASSIGN(UIShell); |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 int main(int argc, const char **argv) { | 45 int main(int argc, const char **argv) { |
| 47 setlocale(LC_ALL, ""); | 46 setlocale(LC_ALL, ""); |
| 48 | 47 |
| 49 base::AtExitManager exit_manager; | 48 base::AtExitManager exit_manager; |
| 50 ui::RegisterPathProvider(); | 49 ui::RegisterPathProvider(); |
| 51 base::CommandLine::Init(argc, argv); | 50 base::CommandLine::Init(argc, argv); |
| 52 base::i18n::InitializeICU(); | 51 base::i18n::InitializeICU(); |
| 53 gfx::GLSurface::InitializeOneOffForTests(); | 52 gfx::GLSurface::InitializeOneOffForTests(); |
| 54 | 53 |
| 55 base::FilePath ui_test_pak_path; | 54 base::FilePath ui_test_pak_path; |
| 56 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 55 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 57 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 56 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 58 | 57 |
| 59 base::MessageLoopForUI message_loop; | 58 base::MessageLoopForUI message_loop; |
| 60 UIShell shell(&message_loop); | 59 UIShell shell(&message_loop); |
| 61 base::RunLoop run_loop; | 60 base::RunLoop run_loop; |
| 62 run_loop.Run(); | 61 run_loop.Run(); |
| 63 } | 62 } |
| OLD | NEW |