OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ | 5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ |
6 #define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ | 6 #define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/views/views_delegate.h" | 9 #include "ui/views/views_delegate.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // DesktopNativeWidgetAura instead of whatever the default native widget would | 23 // DesktopNativeWidgetAura instead of whatever the default native widget would |
24 // be. This has no effect on ChromeOS. | 24 // be. This has no effect on ChromeOS. |
25 void set_use_desktop_native_widgets(bool desktop) { | 25 void set_use_desktop_native_widgets(bool desktop) { |
26 use_desktop_native_widgets_ = desktop; | 26 use_desktop_native_widgets_ = desktop; |
27 } | 27 } |
28 | 28 |
29 void set_use_transparent_windows(bool transparent) { | 29 void set_use_transparent_windows(bool transparent) { |
30 use_transparent_windows_ = transparent; | 30 use_transparent_windows_ = transparent; |
31 } | 31 } |
32 | 32 |
| 33 #if defined(USE_AURA) |
| 34 void set_context_factory(ui::ContextFactory* context_factory) { |
| 35 context_factory_ = context_factory; |
| 36 } |
| 37 #endif |
| 38 |
33 // ViewsDelegate: | 39 // ViewsDelegate: |
34 virtual void OnBeforeWidgetInit( | 40 virtual void OnBeforeWidgetInit( |
35 Widget::InitParams* params, | 41 Widget::InitParams* params, |
36 internal::NativeWidgetDelegate* delegate) OVERRIDE; | 42 internal::NativeWidgetDelegate* delegate) OVERRIDE; |
| 43 #if defined(USE_AURA) |
| 44 virtual ui::ContextFactory* GetContextFactory() OVERRIDE; |
| 45 #endif |
37 | 46 |
38 private: | 47 private: |
39 bool use_desktop_native_widgets_; | 48 bool use_desktop_native_widgets_; |
| 49 |
40 bool use_transparent_windows_; | 50 bool use_transparent_windows_; |
| 51 |
41 #if defined(USE_AURA) | 52 #if defined(USE_AURA) |
42 scoped_ptr<wm::WMState> wm_state_; | 53 scoped_ptr<wm::WMState> wm_state_; |
| 54 |
| 55 ui::ContextFactory* context_factory_; |
43 #endif | 56 #endif |
44 | 57 |
45 DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate); | 58 DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate); |
46 }; | 59 }; |
47 | 60 |
48 } // namespace views | 61 } // namespace views |
49 | 62 |
50 #endif // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ | 63 #endif // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_ |
OLD | NEW |