Chromium Code Reviews| Index: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| index e2427294378e2a7b3f9ce8959d72b524b71565d7..87f0e61c9432fd5a11998f58e4c7cf4ced7f0d20 100644 |
| --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc |
| @@ -108,6 +108,7 @@ void ChromeNativeAppWindowViews::OnBeforeWidgetInit( |
| } |
| void ChromeNativeAppWindowViews::OnBeforePanelWidgetInit( |
| + bool use_default_origin, |
| views::Widget::InitParams* init_params, |
| views::Widget* widget) { |
| } |
| @@ -142,7 +143,7 @@ void ChromeNativeAppWindowViews::InitializeDefaultWindow( |
| SetContentSizeConstraints(create_params.GetContentMinimumSize(frame_insets), |
| create_params.GetContentMaximumSize(frame_insets)); |
| if (!window_bounds.IsEmpty()) { |
| - typedef AppWindow::BoundsSpecification BoundsSpecification; |
| + using BoundsSpecification = AppWindow::BoundsSpecification; |
| bool position_specified = |
| window_bounds.x() != BoundsSpecification::kUnspecifiedPosition && |
| window_bounds.y() != BoundsSpecification::kUnspecifiedPosition; |
| @@ -210,8 +211,17 @@ void ChromeNativeAppWindowViews::InitializePanelWindow( |
| else if (preferred_size_.height() < kMinPanelHeight) |
| preferred_size_.set_height(kMinPanelHeight); |
| - params.bounds = gfx::Rect(preferred_size_); |
| - OnBeforePanelWidgetInit(¶ms, widget()); |
| + params.bounds = gfx::Rect(initial_window_bounds.origin(), preferred_size_); |
| + // When a panel is not docked it will be placed at a default origin in the |
| + // currently active target root window. |
| + bool use_default_position = create_params.state != ui::SHOW_STATE_DOCKED; |
| + OnBeforePanelWidgetInit(use_default_position, ¶ms, widget()); |
| + using BoundsSpecification = AppWindow::BoundsSpecification; |
| + bool position_specified = |
|
benwells
2015/04/29 21:46:42
I'm not sure what this check versus BoundsSpecific
varkha
2015/04/30 02:15:31
See if you like this flow better. I need to saniti
|
| + params.bounds.x() != BoundsSpecification::kUnspecifiedPosition && |
| + params.bounds.y() != BoundsSpecification::kUnspecifiedPosition; |
| + if (!position_specified) |
| + params.bounds = gfx::Rect(preferred_size_); |
| widget()->Init(params); |
| widget()->set_focus_on_creation(create_params.focused); |
| } |