Commit cac640f4 authored by tfarina@chromium.org's avatar tfarina@chromium.org

Set up more pieces necessary to show the main Window for views_examples_exe.

We need to initialize ResourceBundle otherwise we can't call
views::CreateDesktopScreen().

We will also need a gfx::Screen, otherwise we won't have any surface to
show any thing.

BUG=119759,139313,141187
TEST=views_examples_exe runs and does not crash.
R=ben@chromium.org

Review URL: https://codereview.chromium.org/108513015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243898 0039d316-1c4b-4281-b951-d872f2087c98
parent 5d2aa123
......@@ -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;
}
......@@ -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',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment