Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / views / test / test_views_delegate.h
blob022da9a07f4ac83e9e40d55e4b9938962d32010f
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
6 #define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/views/views_delegate.h"
11 namespace wm {
12 class WMState;
15 namespace views {
17 class TestViewsDelegate : public ViewsDelegate {
18 public:
19 TestViewsDelegate();
20 ~TestViewsDelegate() override;
22 // If set to |true|, forces widgets that do not provide a native widget to use
23 // DesktopNativeWidgetAura instead of whatever the default native widget would
24 // be. This has no effect on ChromeOS.
25 void set_use_desktop_native_widgets(bool desktop) {
26 use_desktop_native_widgets_ = desktop;
29 void set_use_transparent_windows(bool transparent) {
30 use_transparent_windows_ = transparent;
33 // Allows tests to provide a ContextFactory via the ViewsDelegate interface.
34 void set_context_factory(ui::ContextFactory* context_factory) {
35 context_factory_ = context_factory;
38 // ViewsDelegate:
39 #if defined(OS_WIN)
40 HICON GetSmallWindowIcon() const override;
41 #endif
42 void OnBeforeWidgetInit(Widget::InitParams* params,
43 internal::NativeWidgetDelegate* delegate) override;
44 ui::ContextFactory* GetContextFactory() override;
46 private:
47 ui::ContextFactory* context_factory_;
48 bool use_desktop_native_widgets_;
49 bool use_transparent_windows_;
51 #if defined(USE_AURA)
52 scoped_ptr<wm::WMState> wm_state_;
53 #endif
55 DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
58 } // namespace views
60 #endif // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_