summaryrefslogtreecommitdiffstats
path: root/ui/views/test
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 19:20:21 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 19:20:21 +0000
commitf24ec6af38c2dc2e3bdf3f5a7e70ad22edf925b4 (patch)
treefe5ae23d07a2fda542e9bac8c913b1d4c1dafc60 /ui/views/test
parent5f91b1f8f0ab9d4c52fa66dcbb2580f2f5ea479a (diff)
downloadchromium_src-f24ec6af38c2dc2e3bdf3f5a7e70ad22edf925b4.zip
chromium_src-f24ec6af38c2dc2e3bdf3f5a7e70ad22edf925b4.tar.gz
chromium_src-f24ec6af38c2dc2e3bdf3f5a7e70ad22edf925b4.tar.bz2
desktop aura: Rip out DesktopNativeWidgetHelperAura and dependencies.
Now that scottmg@ has turned Desktop aura mode on by default, we can safely rip out the old, supporting mode. This doesn't change how {aura,views}_unittests work, which rely on the old notion of having a single RootWindow, but it does make sure that content_browsertests and views_examples_with_content_exe use the correct subclasses. BUG=146077, 151934 Review URL: https://codereview.chromium.org/11263017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/test')
-rw-r--r--ui/views/test/desktop_test_views_delegate.cc31
-rw-r--r--ui/views/test/desktop_test_views_delegate.h32
-rw-r--r--ui/views/test/test_views_delegate.cc9
-rw-r--r--ui/views/test/test_views_delegate.h4
4 files changed, 64 insertions, 12 deletions
diff --git a/ui/views/test/desktop_test_views_delegate.cc b/ui/views/test/desktop_test_views_delegate.cc
new file mode 100644
index 0000000..d70d622
--- /dev/null
+++ b/ui/views/test/desktop_test_views_delegate.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/test/desktop_test_views_delegate.h"
+
+#include "ui/views/widget/desktop_native_widget_aura.h"
+#include "ui/views/widget/native_widget_aura.h"
+
+namespace views {
+
+DesktopTestViewsDelegate::DesktopTestViewsDelegate() {}
+
+DesktopTestViewsDelegate::~DesktopTestViewsDelegate() {}
+
+NativeWidget* DesktopTestViewsDelegate::CreateNativeWidget(
+ Widget::InitParams::Type type,
+ internal::NativeWidgetDelegate* delegate,
+ gfx::NativeView parent) {
+#if defined(USE_AURA) && !defined(OS_CHROMEOS)
+ if (parent && type != views::Widget::InitParams::TYPE_MENU)
+ return new views::NativeWidgetAura(delegate);
+
+ if (!parent)
+ return new views::DesktopNativeWidgetAura(delegate);
+#endif
+
+ return NULL;
+}
+
+} // namespace views
diff --git a/ui/views/test/desktop_test_views_delegate.h b/ui/views/test/desktop_test_views_delegate.h
new file mode 100644
index 0000000..58dc829
--- /dev/null
+++ b/ui/views/test/desktop_test_views_delegate.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_TEST_DESKTOP_TEST_VIEWS_DELEGATE_H_
+#define UI_VIEWS_TEST_DESKTOP_TEST_VIEWS_DELEGATE_H_
+
+#include "ui/views/test/test_views_delegate.h"
+
+namespace views {
+
+// Most aura test code is written assuming a single RootWindow view, however,
+// at higher levels like content_browsertests and
+// views_examples_with_content_exe, we must use the Desktop variants.
+class DesktopTestViewsDelegate : public TestViewsDelegate {
+ public:
+ DesktopTestViewsDelegate();
+ virtual ~DesktopTestViewsDelegate();
+
+ // Overridden from ViewsDelegate:
+ virtual NativeWidget* CreateNativeWidget(
+ Widget::InitParams::Type type,
+ internal::NativeWidgetDelegate* delegate,
+ gfx::NativeView parent) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DesktopTestViewsDelegate);
+};
+
+} // namespace views
+
+#endif
diff --git a/ui/views/test/test_views_delegate.cc b/ui/views/test/test_views_delegate.cc
index e39258ba..d1c8bc6 100644
--- a/ui/views/test/test_views_delegate.cc
+++ b/ui/views/test/test_views_delegate.cc
@@ -9,7 +9,7 @@
#include "content/public/test/web_contents_tester.h"
#if defined(USE_AURA) && !defined(OS_CHROMEOS)
-#include "ui/gfx/screen.h"
+#include "ui/views/widget/native_widget_aura.h"
#include "ui/views/widget/desktop_native_widget_aura.h"
#endif
@@ -55,13 +55,6 @@ int TestViewsDelegate::GetDispositionForEvent(int event_flags) {
return 0;
}
-#if defined(USE_AURA)
-views::NativeWidgetHelperAura* TestViewsDelegate::CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) {
- return NULL;
-}
-#endif
-
content::WebContents* TestViewsDelegate::CreateWebContents(
content::BrowserContext* browser_context,
content::SiteInstance* site_instance) {
diff --git a/ui/views/test/test_views_delegate.h b/ui/views/test/test_views_delegate.h
index 449ea8a..31076eb 100644
--- a/ui/views/test/test_views_delegate.h
+++ b/ui/views/test/test_views_delegate.h
@@ -56,10 +56,6 @@ class TestViewsDelegate : public ViewsDelegate {
virtual void AddRef() OVERRIDE {}
virtual void ReleaseRef() OVERRIDE {}
virtual int GetDispositionForEvent(int event_flags) OVERRIDE;
-#if defined(USE_AURA)
- virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) OVERRIDE;
-#endif
virtual content::WebContents* CreateWebContents(
content::BrowserContext* browser_context,
content::SiteInstance* site_instance) OVERRIDE;