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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); | 613 wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); |
614 } | 614 } |
615 | 615 |
616 ConstrainedWindowViews::~ConstrainedWindowViews() { | 616 ConstrainedWindowViews::~ConstrainedWindowViews() { |
617 } | 617 } |
618 | 618 |
619 //////////////////////////////////////////////////////////////////////////////// | 619 //////////////////////////////////////////////////////////////////////////////// |
620 // ConstrainedWindowViews, ConstrainedWindow implementation: | 620 // ConstrainedWindowViews, ConstrainedWindow implementation: |
621 | 621 |
622 void ConstrainedWindowViews::ShowConstrainedWindow() { | 622 void ConstrainedWindowViews::ShowConstrainedWindow() { |
623 // We marked the view as hidden during construction. Mark it as | |
624 // visible now so FocusManager will let us receive focus. | |
625 non_client_view()->SetVisible(true); | |
626 ConstrainedWindowTabHelper* helper = | 623 ConstrainedWindowTabHelper* helper = |
627 wrapper_->constrained_window_tab_helper(); | 624 wrapper_->constrained_window_tab_helper(); |
628 if (helper && helper->delegate()) | 625 if (helper && helper->delegate()) |
629 helper->delegate()->WillShowConstrainedWindow(wrapper_); | 626 helper->delegate()->WillShowConstrainedWindow(wrapper_); |
630 Activate(); | 627 Show(); |
631 FocusConstrainedWindow(); | 628 FocusConstrainedWindow(); |
632 } | 629 } |
633 | 630 |
634 void ConstrainedWindowViews::CloseConstrainedWindow() { | 631 void ConstrainedWindowViews::CloseConstrainedWindow() { |
635 wrapper_->constrained_window_tab_helper()->WillClose(this); | 632 wrapper_->constrained_window_tab_helper()->WillClose(this); |
636 Close(); | 633 Close(); |
637 } | 634 } |
638 | 635 |
639 void ConstrainedWindowViews::FocusConstrainedWindow() { | 636 void ConstrainedWindowViews::FocusConstrainedWindow() { |
640 ConstrainedWindowTabHelper* helper = | 637 ConstrainedWindowTabHelper* helper = |
(...skipping 21 matching lines...) Expand all Loading... |
662 } | 659 } |
663 | 660 |
664 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 661 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
665 Activate(); | 662 Activate(); |
666 } | 663 } |
667 | 664 |
668 views::internal::NativeWidgetDelegate* | 665 views::internal::NativeWidgetDelegate* |
669 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 666 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
670 return this; | 667 return this; |
671 } | 668 } |
OLD | NEW |