Commit 51289b1d authored by msw@chromium.org's avatar msw@chromium.org

Get views_examples_exe compiling with use_aura=0.

Exclude USE_AURA specific code with preprocessor blocks.
Related to https://codereview.chromium.org/413303003/
(both are needed for a clean build on ToT@285384)

BUG=395507
TEST=NONE
R=sky@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285515 0039d316-1c4b-4281-b951-d872f2087c98
parent 9cfa1257
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "ui/aura/env.h"
#include "ui/base/ime/input_method_initializer.h" #include "ui/base/ime/input_method_initializer.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
...@@ -19,9 +18,13 @@ ...@@ -19,9 +18,13 @@
#include "ui/views/examples/example_base.h" #include "ui/views/examples/example_base.h"
#include "ui/views/examples/examples_window.h" #include "ui/views/examples/examples_window.h"
#include "ui/views/test/desktop_test_views_delegate.h" #include "ui/views/test/desktop_test_views_delegate.h"
#if defined(USE_AURA)
#include "ui/aura/env.h"
#include "ui/wm/core/wm_state.h" #include "ui/wm/core/wm_state.h"
#endif
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) && defined(USE_AURA)
#include "ui/views/widget/desktop_aura/desktop_screen.h" #include "ui/views/widget/desktop_aura/desktop_screen.h"
#endif #endif
...@@ -64,16 +67,18 @@ int main(int argc, char** argv) { ...@@ -64,16 +67,18 @@ int main(int argc, char** argv) {
DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
#if defined(USE_AURA)
aura::Env::CreateInstance(true); aura::Env::CreateInstance(true);
aura::Env::GetInstance()->set_context_factory(context_factory.get()); aura::Env::GetInstance()->set_context_factory(context_factory.get());
#endif
ui::InitializeInputMethodForTesting(); ui::InitializeInputMethodForTesting();
{ {
views::DesktopTestViewsDelegate views_delegate; views::DesktopTestViewsDelegate views_delegate;
#if defined(USE_AURA)
wm::WMState wm_state; wm::WMState wm_state;
#endif
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) && defined(USE_AURA)
scoped_ptr<gfx::Screen> desktop_screen(views::CreateDesktopScreen()); scoped_ptr<gfx::Screen> desktop_screen(views::CreateDesktopScreen());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
desktop_screen.get()); desktop_screen.get());
...@@ -91,7 +96,9 @@ int main(int argc, char** argv) { ...@@ -91,7 +96,9 @@ int main(int argc, char** argv) {
ui::ShutdownInputMethod(); ui::ShutdownInputMethod();
#if defined(USE_AURA)
aura::Env::DeleteInstance(); aura::Env::DeleteInstance();
#endif
return 0; return 0;
} }
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