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 "chrome/browser/ui/views/constrained_window_views.h" | 5 #include "chrome/browser/ui/views/constrained_window_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); | 608 wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); |
609 } | 609 } |
610 | 610 |
611 ConstrainedWindowViews::~ConstrainedWindowViews() { | 611 ConstrainedWindowViews::~ConstrainedWindowViews() { |
612 } | 612 } |
613 | 613 |
614 //////////////////////////////////////////////////////////////////////////////// | 614 //////////////////////////////////////////////////////////////////////////////// |
615 // ConstrainedWindowViews, ConstrainedWindow implementation: | 615 // ConstrainedWindowViews, ConstrainedWindow implementation: |
616 | 616 |
617 void ConstrainedWindowViews::ShowConstrainedWindow() { | 617 void ConstrainedWindowViews::ShowConstrainedWindow() { |
618 // We marked the view as hidden during construction. Mark it as | |
619 // visible now so FocusManager will let us receive focus. | |
620 non_client_view()->SetVisible(true); | |
621 ConstrainedWindowTabHelper* helper = | 618 ConstrainedWindowTabHelper* helper = |
622 wrapper_->constrained_window_tab_helper(); | 619 wrapper_->constrained_window_tab_helper(); |
623 if (helper && helper->delegate()) | 620 if (helper && helper->delegate()) |
624 helper->delegate()->WillShowConstrainedWindow(wrapper_); | 621 helper->delegate()->WillShowConstrainedWindow(wrapper_); |
625 Activate(); | 622 Show(); |
626 FocusConstrainedWindow(); | 623 FocusConstrainedWindow(); |
627 } | 624 } |
628 | 625 |
629 void ConstrainedWindowViews::CloseConstrainedWindow() { | 626 void ConstrainedWindowViews::CloseConstrainedWindow() { |
630 wrapper_->constrained_window_tab_helper()->WillClose(this); | 627 wrapper_->constrained_window_tab_helper()->WillClose(this); |
631 Close(); | 628 Close(); |
632 } | 629 } |
633 | 630 |
634 void ConstrainedWindowViews::FocusConstrainedWindow() { | 631 void ConstrainedWindowViews::FocusConstrainedWindow() { |
635 ConstrainedWindowTabHelper* helper = | 632 ConstrainedWindowTabHelper* helper = |
(...skipping 21 matching lines...) Expand all Loading... |
657 } | 654 } |
658 | 655 |
659 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 656 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
660 Activate(); | 657 Activate(); |
661 } | 658 } |
662 | 659 |
663 views::internal::NativeWidgetDelegate* | 660 views::internal::NativeWidgetDelegate* |
664 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 661 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
665 return this; | 662 return this; |
666 } | 663 } |
OLD | NEW |