- add sources.
[platform/framework/web/crosswalk.git] / src / ui / views / test / test_views_delegate.cc
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 NonClientFrameView* TestViewsDelegate::CreateDefaultNonClientFrameView(
47     Widget* widget) {
48   return NULL;
49 }
50
51 bool TestViewsDelegate::UseTransparentWindows() const {
52   return use_transparent_windows_;
53 }
54
55 content::WebContents* TestViewsDelegate::CreateWebContents(
56     content::BrowserContext* browser_context,
57     content::SiteInstance* site_instance) {
58   return NULL;
59 }
60
61 void TestViewsDelegate::OnBeforeWidgetInit(
62     Widget::InitParams* params,
63     internal::NativeWidgetDelegate* delegate) {
64 }
65
66 base::TimeDelta TestViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
67   return base::TimeDelta();
68 }
69
70 }  // namespace views