summaryrefslogtreecommitdiffstats
path: root/chrome/views/focus_manager_unittest.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
commit0f2f4b60511540e292e085ba5e1985be6bf93908 (patch)
tree6d6bb042fe78bb23c4eca3cf4a4222a3dab38e74 /chrome/views/focus_manager_unittest.cc
parentaaeb9dc745d49afa66c1b613daa5a3123f309955 (diff)
downloadchromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.zip
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.gz
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.bz2
Window Delegate Improvements:
- Windows now must have a Delegate. Just construct the default WindowDelegate if you don't want to have to write one in testing. - Windows now obtain their contents view by asking the delegate via WindowDelegate::GetContentsView. - Contents views no longer need to manually store a pointer to the Window that contains them, WindowDelegate does this automatically via its window() accessor. Reviewer notes: - review window_delegate.h first, then - window.h/cc - custom frame window.h/cc - constrained_window_impl.h/cc - then everything else (just updating all call sites) B=1280060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/focus_manager_unittest.cc')
-rw-r--r--chrome/views/focus_manager_unittest.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/views/focus_manager_unittest.cc b/chrome/views/focus_manager_unittest.cc
index a7a8379..ed5127e 100644
--- a/chrome/views/focus_manager_unittest.cc
+++ b/chrome/views/focus_manager_unittest.cc
@@ -192,14 +192,15 @@ private:
DISALLOW_EVIL_CONSTRUCTORS(BorderView);
};
-class TestViewWindow : public ChromeViews::Window,
- public ChromeViews::WindowDelegate {
+class TestViewWindow : public ChromeViews::HWNDViewContainer {
public:
explicit TestViewWindow(FocusManagerTest* test);
~TestViewWindow() { }
void Init();
- virtual std::wstring GetWindowTitle() const;
+
+ ChromeViews::View* contents() const { return contents_; }
+
// Return the ID of the component that currently has the focus.
int GetFocusedComponentID();
@@ -262,7 +263,7 @@ void TestViewWindow::Init() {
contents_->SetBackground(
ChromeViews::Background::CreateSolidBackground(255, 255, 255));
- Window::Init(NULL, bounds, contents_, this);
+ HWNDViewContainer::Init(NULL, bounds, contents_, true);
ChromeViews::CheckBox* cb =
new ChromeViews::CheckBox(L"This is a checkbox");
@@ -521,11 +522,6 @@ void TestViewWindow::Init() {
contents->SetBounds(200, y, 200, 50);
}
-// WindowDelegate Implementation.
-std::wstring TestViewWindow::GetWindowTitle() const {
- return L"Focus Manager Test Window";
-}
-
////////////////////////////////////////////////////////////////////////////////
// FocusManagerTest
////////////////////////////////////////////////////////////////////////////////
@@ -543,7 +539,7 @@ TestViewWindow* FocusManagerTest::GetWindow() {
void FocusManagerTest::SetUp() {
test_window_ = new TestViewWindow(this);
test_window_->Init();
- test_window_->Show();
+ ShowWindow(test_window_->GetHWND(), SW_SHOW);
}
void FocusManagerTest::TearDown() {