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

Side by Side Diff: athena/main/athena_shell.cc

Issue 316323002: Introduces ActivityFactory for SampleActivity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « athena/main/athena_main.gyp ('k') | athena/main/sample_activity.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
15 #include "ui/aura/window_tree_host.h" 14 #include "ui/aura/window_tree_host.h"
16 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/base/ui_base_paths.h" 16 #include "ui/base/ui_base_paths.h"
18 #include "ui/compositor/test/context_factories_for_test.h" 17 #include "ui/compositor/test/context_factories_for_test.h"
19 #include "ui/gl/gl_surface.h" 18 #include "ui/gl/gl_surface.h"
20 19
21 class UIShell { 20 class UIShell {
22 public: 21 public:
23 explicit UIShell(base::MessageLoopForUI* message_loop) 22 explicit UIShell(base::MessageLoopForUI* message_loop)
24 : athena_helper_(message_loop) { 23 : athena_helper_(message_loop) {
25 const bool enable_pixel_output = true; 24 const bool enable_pixel_output = true;
26 ui::ContextFactory* factory = 25 ui::ContextFactory* factory =
27 ui::InitializeContextFactoryForTests(enable_pixel_output); 26 ui::InitializeContextFactoryForTests(enable_pixel_output);
28 athena_helper_.SetUp(factory); 27 athena_helper_.SetUp(factory);
29 athena_helper_.host()->Show(); 28 athena_helper_.host()->Show();
30 29
31 InitSampleActivities(); 30 InitSampleActivities();
32 } 31 }
33 32
34 void InitSampleActivities() { 33 void InitSampleActivities() {
35 athena::Activity* task = new SampleActivity( 34 athena::ActivityManager::Get()->AddActivity(
36 SK_ColorRED, SK_ColorGREEN, std::string("Activity 1")); 35 athena::ActivityFactory::Get()->CreateWebActivity(
37 athena::ActivityManager::Get()->AddActivity(task); 36 NULL, GURL("http://www.google.com/")));
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 }
OLDNEW
« no previous file with comments | « athena/main/athena_main.gyp ('k') | athena/main/sample_activity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698