diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 15:03:01 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 15:03:01 +0000 |
commit | 9e0534be9784821a8507f20a873d6410b21680e5 (patch) | |
tree | c6dd8baa8bf9986df0168cf54c6a5c8b5c49e0e9 /chrome/browser/views/tab_contents_container_view.cc | |
parent | 1c023d6ec42e2dd30e8a31edbb2cdd49db86cfc4 (diff) | |
download | chromium_src-9e0534be9784821a8507f20a873d6410b21680e5.zip chromium_src-9e0534be9784821a8507f20a873d6410b21680e5.tar.gz chromium_src-9e0534be9784821a8507f20a873d6410b21680e5.tar.bz2 |
Factor find in page out of WebContents and into the view, since it is almost
all view specific. Rename find in page controller to be "FindBarWin", and
find in page view to be "findBarView" (since this is not Windows specific, but
"Views" specific).
I did lots of simplification and moving around of the find in page API. I
coalesced several of the show functions into one master function on the view.
I removed some other sizing and window updating code from WebContents and moved
it to the view.
Review URL: http://codereview.chromium.org/7667
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tab_contents_container_view.cc')
-rw-r--r-- | chrome/browser/views/tab_contents_container_view.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome/browser/views/tab_contents_container_view.cc b/chrome/browser/views/tab_contents_container_view.cc index 7a506fc..c0c013b6 100644 --- a/chrome/browser/views/tab_contents_container_view.cc +++ b/chrome/browser/views/tab_contents_container_view.cc @@ -31,14 +31,21 @@ TabContentsContainerView::~TabContentsContainerView() { void TabContentsContainerView::SetTabContents(TabContents* tab_contents) { if (tab_contents_) { - // TODO(beng): (Cleanup) We want to call the _base_ class' version here. - // WebContents' WM_WINDOWPOSCHANGED handler will ensure its - // version is called. The correct thing to do here is to - // rationalize all TabContents Hide/Show/Size etc into a single - // API, but that's too complex for this first phase. - tab_contents_->TabContents::HideContents(); + // TODO(brettw) should this move to HWNDView::Detach which is called below? + // It needs cleanup regardless. + HWND container_hwnd = tab_contents_->GetContainerHWND(); + + // Hide the contents before adjusting its parent to avoid a full desktop + // flicker. + ::ShowWindow(container_hwnd, SW_HIDE); + + // Reset the parent to NULL to ensure hidden tabs don't receive messages. + ::SetParent(container_hwnd, NULL); + + tab_contents_->WasHidden(); // Unregister the tab contents window from the FocusManager. + views::FocusManager::UninstallFocusSubclass(container_hwnd); HWND hwnd = tab_contents_->GetContentHWND(); if (hwnd) { // We may not have an HWND anymore, if the renderer crashed and we are |