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 #include "ui/views/test/test_views_delegate.h"
      6 
      7 #include "base/command_line.h"
      8 #include "base/logging.h"
      9 #include "content/public/test/web_contents_tester.h"
     10 
     11 #if defined(USE_AURA) && !defined(OS_CHROMEOS)
     12 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
     13 #include "ui/views/widget/native_widget_aura.h"
     14 #endif
     15 
     16 namespace views {
     17 
     18 TestViewsDelegate::TestViewsDelegate()
     19     : use_transparent_windows_(false) {
     20   DCHECK(!ViewsDelegate::views_delegate);
     21   ViewsDelegate::views_delegate = this;
     22 }
     23 
     24 TestViewsDelegate::~TestViewsDelegate() {
     25   ViewsDelegate::views_delegate = NULL;
     26 }
     27 
     28 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) {
     29   use_transparent_windows_ = transparent;
     30 }
     31 
     32 void TestViewsDelegate::SaveWindowPlacement(const Widget* window,
     33                                             const std::string& window_name,
     34                                             const gfx::Rect& bounds,
     35                                             ui::WindowShowState show_state) {
     36 }
     37 
     38 bool TestViewsDelegate::GetSavedWindowPlacement(
     39     const Widget* window,
     40     const std::string& window_name,
     41     gfx::Rect* bounds,
     42     ui:: WindowShowState* show_state) const {
     43   return false;
     44 }
     45 
     46 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
     47 gfx::ImageSkia* TestViewsDelegate::GetDefaultWindowIcon() const {
     48   return NULL;
     49 }
     50 #endif
     51 
     52 NonClientFrameView* TestViewsDelegate::CreateDefaultNonClientFrameView(
     53     Widget* widget) {
     54   return NULL;
     55 }
     56 
     57 bool TestViewsDelegate::UseTransparentWindows() const {
     58   return use_transparent_windows_;
     59 }
     60 
     61 content::WebContents* TestViewsDelegate::CreateWebContents(
     62     content::BrowserContext* browser_context,
     63     content::SiteInstance* site_instance) {
     64   return NULL;
     65 }
     66 
     67 void TestViewsDelegate::OnBeforeWidgetInit(
     68     Widget::InitParams* params,
     69     internal::NativeWidgetDelegate* delegate) {
     70 }
     71 
     72 base::TimeDelta TestViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
     73   return base::TimeDelta();
     74 }
     75 
     76 }  // namespace views
     77