Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 604 ash::SetChildWindowVisibilityChangesAnimated(params.GetParent()); | 604 ash::SetChildWindowVisibilityChangesAnimated(params.GetParent()); |
| 605 // No animations should get performed on the window since that will re-order | 605 // No animations should get performed on the window since that will re-order |
| 606 // the window stack which will then cause many problems. | 606 // the window stack which will then cause many problems. |
| 607 if (params.parent && params.parent->parent()) { | 607 if (params.parent && params.parent->parent()) { |
| 608 params.parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, | 608 params.parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, |
| 609 true); | 609 true); |
| 610 } | 610 } |
| 611 #endif | 611 #endif |
| 612 Init(params); | 612 Init(params); |
| 613 | 613 |
| 614 if (frameless_) | 614 if (frameless_) { |
| 615 // Set the dialog background color. | |
| 616 if (widget_delegate && widget_delegate->AsDialogDelegate()) { | |
| 617 views::Background* background = views::Background::CreateSolidBackground( | |
| 618 ConstrainedWindow::GetBackgroundColor()); | |
| 619 views::DialogClientView* dialog_client_view = | |
| 620 widget_delegate->AsDialogDelegate()->GetDialogClientView(); | |
| 621 if (dialog_client_view) | |
| 622 dialog_client_view->set_background(background); | |
|
please use gerrit instead
2012/10/11 00:39:40
Adding this back in, because this background is st
| |
| 623 } | |
| 624 | |
| 615 PositionFramelessWindow(); | 625 PositionFramelessWindow(); |
| 626 } | |
| 616 | 627 |
| 617 ConstrainedWindowTabHelper* constrained_window_tab_helper = | 628 ConstrainedWindowTabHelper* constrained_window_tab_helper = |
| 618 ConstrainedWindowTabHelper::FromWebContents(web_contents_); | 629 ConstrainedWindowTabHelper::FromWebContents(web_contents_); |
| 619 constrained_window_tab_helper->AddConstrainedDialog(this); | 630 constrained_window_tab_helper->AddConstrainedDialog(this); |
| 620 #if defined(USE_ASH) | 631 #if defined(USE_ASH) |
| 621 GetNativeWindow()->SetProperty(ash::kConstrainedWindowKey, true); | 632 GetNativeWindow()->SetProperty(ash::kConstrainedWindowKey, true); |
| 622 #endif | 633 #endif |
| 623 } | 634 } |
| 624 | 635 |
| 625 ConstrainedWindowViews::~ConstrainedWindowViews() { | 636 ConstrainedWindowViews::~ConstrainedWindowViews() { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 723 BrowserWindow* browser_window = | 734 BrowserWindow* browser_window = |
| 724 tab_helper_delegate ? tab_helper_delegate->GetBrowserWindow() : NULL; | 735 tab_helper_delegate ? tab_helper_delegate->GetBrowserWindow() : NULL; |
| 725 int top_y; | 736 int top_y; |
| 726 if (browser_window && browser_window->GetConstrainedWindowTopY(&top_y)) { | 737 if (browser_window && browser_window->GetConstrainedWindowTopY(&top_y)) { |
| 727 bounds.set_y(top_y); | 738 bounds.set_y(top_y); |
| 728 bounds.set_x( | 739 bounds.set_x( |
| 729 browser_window->GetBounds().width() / 2 - bounds.width() / 2); | 740 browser_window->GetBounds().width() / 2 - bounds.width() / 2); |
| 730 SetBounds(bounds); | 741 SetBounds(bounds); |
| 731 } | 742 } |
| 732 } | 743 } |
| OLD | NEW |