• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
TestViewsDelegate()18 TestViewsDelegate::TestViewsDelegate()
19     : use_transparent_windows_(false) {
20   DCHECK(!ViewsDelegate::views_delegate);
21   ViewsDelegate::views_delegate = this;
22 }
23 
~TestViewsDelegate()24 TestViewsDelegate::~TestViewsDelegate() {
25   ViewsDelegate::views_delegate = NULL;
26 }
27 
SetUseTransparentWindows(bool transparent)28 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) {
29   use_transparent_windows_ = transparent;
30 }
31 
SaveWindowPlacement(const Widget * window,const std::string & window_name,const gfx::Rect & bounds,ui::WindowShowState show_state)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 
GetSavedWindowPlacement(const Widget * window,const std::string & window_name,gfx::Rect * bounds,ui::WindowShowState * show_state) const38 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)
GetDefaultWindowIcon() const47 gfx::ImageSkia* TestViewsDelegate::GetDefaultWindowIcon() const {
48   return NULL;
49 }
50 #endif
51 
CreateDefaultNonClientFrameView(Widget * widget)52 NonClientFrameView* TestViewsDelegate::CreateDefaultNonClientFrameView(
53     Widget* widget) {
54   return NULL;
55 }
56 
UseTransparentWindows() const57 bool TestViewsDelegate::UseTransparentWindows() const {
58   return use_transparent_windows_;
59 }
60 
CreateWebContents(content::BrowserContext * browser_context,content::SiteInstance * site_instance)61 content::WebContents* TestViewsDelegate::CreateWebContents(
62     content::BrowserContext* browser_context,
63     content::SiteInstance* site_instance) {
64   return NULL;
65 }
66 
OnBeforeWidgetInit(Widget::InitParams * params,internal::NativeWidgetDelegate * delegate)67 void TestViewsDelegate::OnBeforeWidgetInit(
68     Widget::InitParams* params,
69     internal::NativeWidgetDelegate* delegate) {
70 }
71 
GetDefaultTextfieldObscuredRevealDuration()72 base::TimeDelta TestViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
73   return base::TimeDelta();
74 }
75 
76 }  // namespace views
77