Chromium Code Reviews| Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
| diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
| index abc6fb929eafbf966d5119a69f6b1bad7c1b5858..c0a19e43e259b88ac99675657a5433b0adb39b04 100644 |
| --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
| +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
| @@ -6,6 +6,7 @@ |
| #include "apps/ui/views/app_window_frame_view.h" |
| #include "ash/common/ash_constants.h" |
| +#include "ash/common/ash_switches.h" |
| #include "ash/common/frame/custom_frame_view_ash.h" |
| #include "ash/common/shelf/shelf_item_types.h" |
| #include "ash/common/wm/panels/panel_frame_view.h" |
| @@ -128,9 +129,14 @@ void ChromeNativeAppWindowViewsAuraAsh::InitializeWindow( |
| const AppWindow::CreateParams& create_params) { |
| ChromeNativeAppWindowViewsAura::InitializeWindow(app_window, create_params); |
| aura::Window* window = widget()->GetNativeWindow(); |
| - // Restore docked state on ash desktop. |
| - if (create_params.state == ui::SHOW_STATE_DOCKED) |
| + |
| + // TODO(afakhry): Remove in M58. |
| + // Restore docked state on ash desktop if the docked windows flag is enabled. |
| + if (create_params.state == ui::SHOW_STATE_DOCKED && |
| + ash::switches::DockedWindowsEnabled()) { |
| window->SetProperty(aura::client::kShowStateKey, create_params.state); |
| + } |
| + |
| window->SetProperty(aura::client::kAppIdKey, |
| new std::string(app_window->extension_id())); |
| @@ -224,10 +230,14 @@ ChromeNativeAppWindowViewsAuraAsh::GetRestoredState() const { |
| } |
| return ui::SHOW_STATE_FULLSCREEN; |
| } |
| - if (widget()->GetNativeWindow()->GetProperty(aura::client::kShowStateKey) == |
| - ui::SHOW_STATE_DOCKED || |
| - widget()->GetNativeWindow()->GetProperty( |
| - aura::client::kPreMinimizedShowStateKey) == ui::SHOW_STATE_DOCKED) { |
| + |
| + // TODO(afakhry): Remove in M58. |
| + if (ash::switches::DockedWindowsEnabled() && |
| + (widget()->GetNativeWindow()->GetProperty( |
| + aura::client::kShowStateKey) == ui::SHOW_STATE_DOCKED || |
|
varkha
2017/01/26 22:34:53
nit: We should not really be getting here anymore
afakhry
2017/01/27 02:43:44
We should be able to get here if the flag is disab
varkha
2017/01/27 03:24:43
I thought if DockedWindowsEnabled returns true the
|
| + widget()->GetNativeWindow()->GetProperty( |
| + aura::client::kPreMinimizedShowStateKey) == |
| + ui::SHOW_STATE_DOCKED)) { |
| return ui::SHOW_STATE_DOCKED; |
| } |
| } |