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/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "base/memory/scoped_ptr.h"
     11 #include "build/build_config.h"
     12 #include "ui/base/accessibility/accessibility_types.h"
     13 #include "ui/views/views_delegate.h"
     14 
     15 namespace ui {
     16 class Clipboard;
     17 }
     18 
     19 namespace views {
     20 class View;
     21 class Widget;
     22 
     23 class TestViewsDelegate : public ViewsDelegate {
     24  public:
     25   TestViewsDelegate();
     26   virtual ~TestViewsDelegate();
     27 
     28   void SetUseTransparentWindows(bool transparent);
     29 
     30   // Overridden from ViewsDelegate:
     31   virtual void SaveWindowPlacement(const Widget* window,
     32                                    const std::string& window_name,
     33                                    const gfx::Rect& bounds,
     34                                    ui::WindowShowState show_state) OVERRIDE;
     35   virtual bool GetSavedWindowPlacement(
     36       const Widget* window,
     37       const std::string& window_name,
     38       gfx::Rect* bounds,
     39       ui::WindowShowState* show_state) const OVERRIDE;
     40 
     41   virtual void NotifyAccessibilityEvent(
     42       View* view, ui::AccessibilityTypes::Event event_type) OVERRIDE {}
     43 
     44   virtual void NotifyMenuItemFocused(const string16& menu_name,
     45                                      const string16& menu_item_name,
     46                                      int item_index,
     47                                      int item_count,
     48                                      bool has_submenu) OVERRIDE {}
     49 #if defined(OS_WIN)
     50   virtual HICON GetDefaultWindowIcon() const OVERRIDE {
     51     return NULL;
     52   }
     53 
     54   virtual bool IsWindowInMetro(gfx::NativeWindow window) const {
     55     return false;
     56   }
     57 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
     58   virtual gfx::ImageSkia* GetDefaultWindowIcon() const OVERRIDE;
     59 #endif
     60   virtual NonClientFrameView* CreateDefaultNonClientFrameView(
     61       Widget* widget) OVERRIDE;
     62   virtual bool UseTransparentWindows() const OVERRIDE;
     63   virtual void AddRef() OVERRIDE {}
     64   virtual void ReleaseRef() OVERRIDE {}
     65   virtual content::WebContents* CreateWebContents(
     66       content::BrowserContext* browser_context,
     67       content::SiteInstance* site_instance) OVERRIDE;
     68   virtual void OnBeforeWidgetInit(
     69       Widget::InitParams* params,
     70       internal::NativeWidgetDelegate* delegate) OVERRIDE;
     71   virtual base::TimeDelta GetDefaultTextfieldObscuredRevealDuration() OVERRIDE;
     72 
     73  private:
     74   bool use_transparent_windows_;
     75 
     76   DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
     77 };
     78 
     79 }  // namespace views
     80 
     81 #endif  // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
     82