diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-20 00:48:31 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-20 00:48:31 +0000 |
commit | c95ec93e47364e0386e1a1ac09b353e6e2c83b45 (patch) | |
tree | 1bdd91a44ddced8a6fb56f849a1aadc5e3fcda56 /ui/views/examples | |
parent | ff3761a21bdd9985d559d45e50fbaecf69df16ab (diff) | |
download | chromium_src-c95ec93e47364e0386e1a1ac09b353e6e2c83b45.zip chromium_src-c95ec93e47364e0386e1a1ac09b353e6e2c83b45.tar.gz chromium_src-c95ec93e47364e0386e1a1ac09b353e6e2c83b45.tar.bz2 |
Recommitting Aura/ash split: Remove hacks and get chrome linking without ash.
This changes TestViewsDelegate::CreateNativeWidgetHelper to always return NULL, and for views_examples_exe to use its own subclass that create the desktop implementation.
For the first time now, you can do:
> build/gyp_chromium -Duse_aura=1 -Duse_ash=0
And get a running chrome. It has lots of issues, especially related to
window placement, tab handling, etc, but it pops up and renders web content.
Also consolidates most of the desktop behavior into its own class.
Also makes views_examples_exe work again. Several of the hacks are no longer
needed after Ben's refactoring to support WebView.
BUG=116458,119759
TEST=none
First Review URL: http://codereview.chromium.org/10081022
Review URL: http://codereview.chromium.org/10083058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/examples')
-rw-r--r-- | ui/views/examples/content_client/examples_browser_main_parts.cc | 45 | ||||
-rw-r--r-- | ui/views/examples/content_client/examples_browser_main_parts.h | 8 |
2 files changed, 22 insertions, 31 deletions
diff --git a/ui/views/examples/content_client/examples_browser_main_parts.cc b/ui/views/examples/content_client/examples_browser_main_parts.cc index 62d3686..e1233e3 100644 --- a/ui/views/examples/content_client/examples_browser_main_parts.cc +++ b/ui/views/examples/content_client/examples_browser_main_parts.cc @@ -23,39 +23,28 @@ #include "ui/views/focus/accelerator_handler.h" #if defined(USE_AURA) -#include "ui/aura/client/stacking_client.h" +#if !defined(USE_ASH) +#include "ui/views/widget/desktop_native_widget_helper_aura.h" +#endif +#include "ui/aura/desktop/desktop_stacking_client.h" #include "ui/aura/env.h" -#include "ui/aura/root_window.h" -#include "ui/aura/window.h" -#include "ui/gfx/compositor/compositor.h" -#include "ui/gfx/compositor/test/compositor_test_support.h" #include "ui/views/widget/native_widget_aura.h" #endif namespace views { namespace examples { + namespace { -#if defined(USE_AURA) -class RootWindowStackingClient : public aura::client::StackingClient { +class ExamplesViewsDelegate : public views::TestViewsDelegate { public: - explicit RootWindowStackingClient() { - aura::client::SetStackingClient(this); - } - - virtual ~RootWindowStackingClient() { - aura::client::SetStackingClient(NULL); +#if defined(USE_AURA) && !defined(USE_ASH) + virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper( + views::NativeWidgetAura* native_widget) OVERRIDE { + return new views::DesktopNativeWidgetHelperAura(native_widget); } - - // Overridden from aura::client::StackingClient: - virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE { - return window->GetRootWindow(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(RootWindowStackingClient); +#endif // !USE_ASH }; -#endif -} +} // namespace ExamplesBrowserMainParts::ExamplesBrowserMainParts( const content::MainFunctionParams& parameters) @@ -79,12 +68,9 @@ void ExamplesBrowserMainParts::PreMainMessageLoopRun() { browser_context_.reset(new content::ShellBrowserContext); #if defined(USE_AURA) - // TURN ON THE HAX. - views::NativeWidgetAura::set_aura_desktop_hax(); - ui::CompositorTestSupport::Initialize(); - root_window_stacking_client_.reset(new RootWindowStackingClient); + stacking_client_.reset(new aura::DesktopStackingClient); #endif - views_delegate_.reset(new views::TestViewsDelegate); + views_delegate_.reset(new ExamplesViewsDelegate); views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, browser_context_.get()); @@ -96,9 +82,8 @@ void ExamplesBrowserMainParts::PostMainMessageLoopRun() { browser_context_.reset(); views_delegate_.reset(); #if defined(USE_AURA) - root_window_stacking_client_.reset(); + stacking_client_.reset(); aura::Env::DeleteInstance(); - ui::CompositorTestSupport::Terminate(); #endif } diff --git a/ui/views/examples/content_client/examples_browser_main_parts.h b/ui/views/examples/content_client/examples_browser_main_parts.h index bdbcbc9..ea4e959 100644 --- a/ui/views/examples/content_client/examples_browser_main_parts.h +++ b/ui/views/examples/content_client/examples_browser_main_parts.h @@ -10,6 +10,12 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_main_parts.h" +namespace aura { +namespace client { +class StackingClient; +} +} + namespace base { class Thread; } @@ -63,7 +69,7 @@ class ExamplesBrowserMainParts : public content::BrowserMainParts { content::ShellDevToolsDelegate* devtools_delegate_; scoped_ptr<views::ViewsDelegate> views_delegate_; #if defined(USE_AURA) - scoped_ptr<aura::client::StackingClient> root_window_stacking_client_; + scoped_ptr<aura::client::StackingClient> stacking_client_; #endif DISALLOW_COPY_AND_ASSIGN(ExamplesBrowserMainParts); |