OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/constrained_window_win.h" | 5 #include "chrome/browser/views/constrained_window_win.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 ConstrainedWindowWin::~ConstrainedWindowWin() { | 585 ConstrainedWindowWin::~ConstrainedWindowWin() { |
586 } | 586 } |
587 | 587 |
588 //////////////////////////////////////////////////////////////////////////////// | 588 //////////////////////////////////////////////////////////////////////////////// |
589 // ConstrainedWindowWin, ConstrainedWindow implementation: | 589 // ConstrainedWindowWin, ConstrainedWindow implementation: |
590 | 590 |
591 views::NonClientFrameView* ConstrainedWindowWin::CreateFrameViewForWindow() { | 591 views::NonClientFrameView* ConstrainedWindowWin::CreateFrameViewForWindow() { |
592 return new ConstrainedWindowFrameView(this); | 592 return new ConstrainedWindowFrameView(this); |
593 } | 593 } |
594 | 594 |
| 595 void ConstrainedWindowWin::ShowConstrainedWindow() { |
| 596 ActivateConstrainedWindow(); |
| 597 } |
| 598 |
595 void ConstrainedWindowWin::CloseConstrainedWindow() { | 599 void ConstrainedWindowWin::CloseConstrainedWindow() { |
596 // Broadcast to all observers of NOTIFY_CWINDOW_CLOSED. | 600 // Broadcast to all observers of NOTIFY_CWINDOW_CLOSED. |
597 // One example of such an observer is AutomationCWindowTracker in the | 601 // One example of such an observer is AutomationCWindowTracker in the |
598 // automation component. | 602 // automation component. |
599 NotificationService::current()->Notify(NotificationType::CWINDOW_CLOSED, | 603 NotificationService::current()->Notify(NotificationType::CWINDOW_CLOSED, |
600 Source<ConstrainedWindow>(this), | 604 Source<ConstrainedWindow>(this), |
601 NotificationService::NoDetails()); | 605 NotificationService::NoDetails()); |
602 | 606 |
603 Close(); | 607 Close(); |
604 } | 608 } |
(...skipping 20 matching lines...) Expand all Loading... |
625 views::WindowDelegate* window_delegate) | 629 views::WindowDelegate* window_delegate) |
626 : WindowWin(window_delegate), | 630 : WindowWin(window_delegate), |
627 owner_(owner) { | 631 owner_(owner) { |
628 GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); | 632 GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); |
629 | 633 |
630 set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | | 634 set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | |
631 WS_THICKFRAME | WS_SYSMENU); | 635 WS_THICKFRAME | WS_SYSMENU); |
632 set_focus_on_creation(false); | 636 set_focus_on_creation(false); |
633 | 637 |
634 WindowWin::Init(owner_->GetNativeView(), gfx::Rect()); | 638 WindowWin::Init(owner_->GetNativeView(), gfx::Rect()); |
635 ActivateConstrainedWindow(); | |
636 } | 639 } |
637 | 640 |
638 void ConstrainedWindowWin::ActivateConstrainedWindow() { | 641 void ConstrainedWindowWin::ActivateConstrainedWindow() { |
639 // Other pop-ups are simply moved to the front of the z-order. | 642 // Other pop-ups are simply moved to the front of the z-order. |
640 SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); | 643 SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); |
641 } | 644 } |
642 | 645 |
643 //////////////////////////////////////////////////////////////////////////////// | 646 //////////////////////////////////////////////////////////////////////////////// |
644 // ConstrainedWindowWin, views::WidgetWin overrides: | 647 // ConstrainedWindowWin, views::WidgetWin overrides: |
645 | 648 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 684 |
682 | 685 |
683 // static | 686 // static |
684 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( | 687 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( |
685 TabContents* parent, | 688 TabContents* parent, |
686 views::WindowDelegate* window_delegate) { | 689 views::WindowDelegate* window_delegate) { |
687 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, | 690 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, |
688 window_delegate); | 691 window_delegate); |
689 return window; | 692 return window; |
690 } | 693 } |
OLD | NEW |