summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/views/examples/examples_main.cc25
-rw-r--r--ui/views/views.gyp4
2 files changed, 28 insertions, 1 deletions
diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc
index dc8b7ac..d9fc66b 100644
--- a/ui/views/examples/examples_main.cc
+++ b/ui/views/examples/examples_main.cc
@@ -4,16 +4,39 @@
#include "base/at_exit.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
+#include "base/path_service.h"
#include "base/run_loop.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/screen.h"
+
+#if !defined(OS_CHROMEOS)
+#include "ui/views/widget/desktop_aura/desktop_screen.h"
+#endif
int main(int argc, char** argv) {
- base::AtExitManager at_exit;
CommandLine::Init(argc, argv);
+ base::AtExitManager at_exit;
base::MessageLoopForUI message_loop;
+ base::FilePath pak_dir;
+ PathService::Get(base::DIR_MODULE, &pak_dir);
+
+ base::FilePath pak_file;
+ pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak"));
+
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
+
+#if !defined(OS_CHROMEOS)
+ scoped_ptr<gfx::Screen> desktop_screen(views::CreateDesktopScreen());
+ gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, desktop_screen.get());
+#endif
+
base::RunLoop().Run();
+ ui::ResourceBundle::CleanupSharedInstance();
+
return 0;
}
diff --git a/ui/views/views.gyp b/ui/views/views.gyp
index 3cfd592..a3d3a2b 100644
--- a/ui/views/views.gyp
+++ b/ui/views/views.gyp
@@ -961,6 +961,10 @@
'type': 'executable',
'dependencies': [
'../../base/base.gyp:base',
+ '../gfx/gfx.gyp:gfx',
+ '../resources/ui_resources.gyp:ui_test_pak',
+ '../ui.gyp:ui',
+ 'views',
],
'sources': [
'examples/examples_main.cc',