OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 window_ = Widget::CreateWindowWithBounds(this, bounds()); | 119 window_ = Widget::CreateWindowWithBounds(this, bounds()); |
120 InitContentView(); | 120 InitContentView(); |
121 window_->Show(); | 121 window_->Show(); |
122 } | 122 } |
123 | 123 |
124 virtual void TearDown() OVERRIDE { | 124 virtual void TearDown() OVERRIDE { |
125 if (focus_change_listener_) | 125 if (focus_change_listener_) |
126 GetFocusManager()->RemoveFocusChangeListener(focus_change_listener_); | 126 GetFocusManager()->RemoveFocusChangeListener(focus_change_listener_); |
127 window_->Close(); | 127 window_->Close(); |
128 | 128 |
129 // Flush the message loop to make Purify happy. | 129 // Flush the message loop to make application verifiers happy. |
130 message_loop()->RunAllPending(); | 130 message_loop()->RunAllPending(); |
131 } | 131 } |
132 | 132 |
133 FocusManager* GetFocusManager() { | 133 FocusManager* GetFocusManager() { |
134 return window_->GetFocusManager(); | 134 return window_->GetFocusManager(); |
135 } | 135 } |
136 | 136 |
137 void FocusNativeView(gfx::NativeView native_view) { | 137 void FocusNativeView(gfx::NativeView native_view) { |
138 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
139 ::SendMessage(native_view, WM_SETFOCUS, NULL, NULL); | 139 ::SendMessage(native_view, WM_SETFOCUS, NULL, NULL); |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size())); | 1727 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size())); |
1728 | 1728 |
1729 // Focus manager should be the last one to destruct. | 1729 // Focus manager should be the last one to destruct. |
1730 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); | 1730 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); |
1731 | 1731 |
1732 // Clear window_ so that we don't try to close it again. | 1732 // Clear window_ so that we don't try to close it again. |
1733 window_ = NULL; | 1733 window_ = NULL; |
1734 } | 1734 } |
1735 | 1735 |
1736 } // namespace views | 1736 } // namespace views |
OLD | NEW |