diff options
Diffstat (limited to 'chrome/browser/views/constrained_window_impl.cc')
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index af40fc5..4ff891e 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -592,28 +592,6 @@ views::NonClientFrameView* ConstrainedWindowImpl::CreateFrameViewForWindow() { return new ConstrainedWindowFrameView(this); } -void ConstrainedWindowImpl::ActivateConstrainedWindow() { - // Other pop-ups are simply moved to the front of the z-order. - SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - - // Store the focus of our parent focus manager so we can restore it when we - // close. - views::FocusManager* focus_manager = - views::FocusManager::GetFocusManager(GetNativeView()); - DCHECK(focus_manager); - focus_manager = focus_manager->GetParentFocusManager(); - if (focus_manager) { - // We could not have a parent focus manager if the ConstrainedWindow is - // displayed in a tab that is not currently selected. - // TODO(jcampan): we should store the ConstrainedWindow active events in - // that case and replay them when the TabContents becomes selected. - focus_manager->StoreFocusedView(); - - // Give our window the focus so we get keyboard messages. - ::SetFocus(GetNativeView()); - } -} - void ConstrainedWindowImpl::CloseConstrainedWindow() { // Broadcast to all observers of NOTIFY_CWINDOW_CLOSED. // One example of such an observer is AutomationCWindowTracker in the @@ -625,14 +603,6 @@ void ConstrainedWindowImpl::CloseConstrainedWindow() { Close(); } -void ConstrainedWindowImpl::WasHidden() { - DLOG(INFO) << "WasHidden"; -} - -void ConstrainedWindowImpl::DidBecomeSelected() { - DLOG(INFO) << "DidBecomeSelected"; -} - std::wstring ConstrainedWindowImpl::GetWindowTitle() const { std::wstring display_title; if (GetDelegate()) @@ -671,6 +641,28 @@ void ConstrainedWindowImpl::InitAsDialog(const gfx::Rect& initial_bounds) { ActivateConstrainedWindow(); } +void ConstrainedWindowImpl::ActivateConstrainedWindow() { + // Other pop-ups are simply moved to the front of the z-order. + SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); + + // Store the focus of our parent focus manager so we can restore it when we + // close. + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetNativeView()); + DCHECK(focus_manager); + focus_manager = focus_manager->GetParentFocusManager(); + if (focus_manager) { + // We could not have a parent focus manager if the ConstrainedWindow is + // displayed in a tab that is not currently selected. + // TODO(jcampan): we should store the ConstrainedWindow active events in + // that case and replay them when the TabContents becomes selected. + focus_manager->StoreFocusedView(); + + // Give our window the focus so we get keyboard messages. + ::SetFocus(GetNativeView()); + } +} + //////////////////////////////////////////////////////////////////////////////// // ConstrainedWindowImpl, views::WidgetWin overrides: |