Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: ash/test/ash_test_views_delegate.h

Issue 280863002: Reduce creation of ViewsDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add widget includes for undef CreateWindow Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | ash/test/ash_test_views_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_views_delegate.h
diff --git a/ash/test/ash_test_views_delegate.h b/ash/test/ash_test_views_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..6fd8bd4bc08912f65c1c6effa40be221b19aa0b8
--- /dev/null
+++ b/ash/test/ash_test_views_delegate.h
@@ -0,0 +1,37 @@
+// Copyright 2014 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 ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_
+#define ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_
+
+#include "ui/views/test/test_views_delegate.h"
+
+namespace ash {
+namespace test {
+
+// Ash specific ViewsDelegate. In addition to creating a TestWebContents this
+// parents widget with no parent/context to the shell. This is created by
+// default AshTestHelper.
+class AshTestViewsDelegate : public views::TestViewsDelegate {
+ public:
+ AshTestViewsDelegate();
+ virtual ~AshTestViewsDelegate();
+
+ // Overriden from TestViewsDelegate.
+ virtual content::WebContents* CreateWebContents(
+ content::BrowserContext* browser_context,
+ content::SiteInstance* site_instance) OVERRIDE;
+ virtual void OnBeforeWidgetInit(
+ views::Widget::InitParams* params,
+ views::internal::NativeWidgetDelegate* delegate) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AshTestViewsDelegate);
+};
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_
+
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | ash/test/ash_test_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698