| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/test/test_views_delegate.h" | 5 #include "ui/views/test/test_views_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/public/test/web_contents_tester.h" | 9 #include "content/public/test/web_contents_tester.h" |
| 10 | 10 |
| 11 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 11 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 12 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 12 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 13 #include "ui/views/widget/native_widget_aura.h" | 13 #include "ui/views/widget/native_widget_aura.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #if defined(USE_AURA) |
| 17 #include "ui/views/corewm/transient_window_stacking_client.h" |
| 18 #endif |
| 19 |
| 16 namespace views { | 20 namespace views { |
| 17 | 21 |
| 18 TestViewsDelegate::TestViewsDelegate() | 22 TestViewsDelegate::TestViewsDelegate() |
| 19 : use_transparent_windows_(false) { | 23 : use_transparent_windows_(false) { |
| 20 DCHECK(!ViewsDelegate::views_delegate); | 24 DCHECK(!ViewsDelegate::views_delegate); |
| 21 ViewsDelegate::views_delegate = this; | 25 ViewsDelegate::views_delegate = this; |
| 26 #if defined(USE_AURA) |
| 27 // SetWindowStackingClient() takes ownership of TransientWindowStackingClient. |
| 28 aura::client::SetWindowStackingClient( |
| 29 new corewm::TransientWindowStackingClient); |
| 30 #endif |
| 22 } | 31 } |
| 23 | 32 |
| 24 TestViewsDelegate::~TestViewsDelegate() { | 33 TestViewsDelegate::~TestViewsDelegate() { |
| 25 ViewsDelegate::views_delegate = NULL; | 34 ViewsDelegate::views_delegate = NULL; |
| 35 #if defined(USE_AURA) |
| 36 aura::client::SetWindowStackingClient(NULL); |
| 37 #endif |
| 26 } | 38 } |
| 27 | 39 |
| 28 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) { | 40 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) { |
| 29 use_transparent_windows_ = transparent; | 41 use_transparent_windows_ = transparent; |
| 30 } | 42 } |
| 31 | 43 |
| 32 void TestViewsDelegate::SaveWindowPlacement(const Widget* window, | 44 void TestViewsDelegate::SaveWindowPlacement(const Widget* window, |
| 33 const std::string& window_name, | 45 const std::string& window_name, |
| 34 const gfx::Rect& bounds, | 46 const gfx::Rect& bounds, |
| 35 ui::WindowShowState show_state) { | 47 ui::WindowShowState show_state) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void TestViewsDelegate::OnBeforeWidgetInit( | 79 void TestViewsDelegate::OnBeforeWidgetInit( |
| 68 Widget::InitParams* params, | 80 Widget::InitParams* params, |
| 69 internal::NativeWidgetDelegate* delegate) { | 81 internal::NativeWidgetDelegate* delegate) { |
| 70 } | 82 } |
| 71 | 83 |
| 72 base::TimeDelta TestViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { | 84 base::TimeDelta TestViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { |
| 73 return base::TimeDelta(); | 85 return base::TimeDelta(); |
| 74 } | 86 } |
| 75 | 87 |
| 76 } // namespace views | 88 } // namespace views |
| OLD | NEW |