Home | History | Annotate | Download | only in test
      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.
      4 
      5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
      6 #define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
      7 
      8 #include "base/memory/scoped_ptr.h"
      9 #include "ui/views/views_delegate.h"
     10 
     11 namespace wm {
     12 class WMState;
     13 }
     14 
     15 namespace views {
     16 
     17 class TestViewsDelegate : public ViewsDelegate {
     18  public:
     19   TestViewsDelegate();
     20   virtual ~TestViewsDelegate();
     21 
     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;
     27   }
     28 
     29   void set_use_transparent_windows(bool transparent) {
     30     use_transparent_windows_ = transparent;
     31   }
     32 
     33   // ViewsDelegate:
     34   virtual void OnBeforeWidgetInit(
     35       Widget::InitParams* params,
     36       internal::NativeWidgetDelegate* delegate) OVERRIDE;
     37 
     38  private:
     39   bool use_desktop_native_widgets_;
     40 
     41   bool use_transparent_windows_;
     42 
     43 #if defined(USE_AURA)
     44   scoped_ptr<wm::WMState> wm_state_;
     45 
     46   ui::ContextFactory* context_factory_;
     47 #endif
     48 
     49   DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
     50 };
     51 
     52 }  // namespace views
     53 
     54 #endif  // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
     55