Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/apps/chrome_native_app_window_views_aura_ash.h " | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.h " |
| 6 | 6 |
| 7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/frame/custom_frame_view_ash.h" | 10 #include "ash/common/frame/custom_frame_view_ash.h" |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm/window_state_delegate.h" | 13 #include "ash/common/wm/window_state_delegate.h" |
| 14 #include "ash/common/wm/window_state_observer.h" | 14 #include "ash/common/wm/window_state_observer.h" |
| 15 #include "ash/screen_util.h" | 15 #include "ash/screen_util.h" |
| 16 #include "ash/shared/immersive_fullscreen_controller.h" | 16 #include "ash/shared/immersive_fullscreen_controller.h" |
| 17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 18 #include "ash/wm/panels/panel_frame_view.h" | 18 #include "ash/wm/panels/panel_frame_view.h" |
| 19 #include "ash/wm/window_properties.h" | 19 #include "ash/wm/window_properties.h" |
| 20 #include "ash/wm/window_state_aura.h" | 20 #include "ash/wm/window_state_aura.h" |
| 21 #include "chrome/browser/ui/ash/ash_util.h" | 21 #include "chrome/browser/ui/ash/ash_util.h" |
| 22 #include "chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h" | |
| 22 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" | 23 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" |
| 23 #include "services/ui/public/cpp/property_type_converters.h" | 24 #include "services/ui/public/cpp/property_type_converters.h" |
| 24 #include "services/ui/public/cpp/window.h" | 25 #include "services/ui/public/cpp/window.h" |
| 25 #include "services/ui/public/interfaces/window_manager.mojom.h" | 26 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 26 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
| 27 #include "ui/aura/mus/mus_util.h" | 28 #include "ui/aura/mus/mus_util.h" |
| 28 #include "ui/aura/window.h" | 29 #include "ui/aura/window.h" |
| 29 #include "ui/aura/window_observer.h" | 30 #include "ui/aura/window_observer.h" |
| 30 #include "ui/base/hit_test.h" | 31 #include "ui/base/hit_test.h" |
| 31 #include "ui/base/models/simple_menu_model.h" | 32 #include "ui/base/models/simple_menu_model.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 | 126 |
| 126 void ChromeNativeAppWindowViewsAuraAsh::InitializeWindow( | 127 void ChromeNativeAppWindowViewsAuraAsh::InitializeWindow( |
| 127 AppWindow* app_window, | 128 AppWindow* app_window, |
| 128 const AppWindow::CreateParams& create_params) { | 129 const AppWindow::CreateParams& create_params) { |
| 129 ChromeNativeAppWindowViewsAura::InitializeWindow(app_window, create_params); | 130 ChromeNativeAppWindowViewsAura::InitializeWindow(app_window, create_params); |
| 130 // Restore docked state on ash desktop. | 131 // Restore docked state on ash desktop. |
| 131 if (create_params.state == ui::SHOW_STATE_DOCKED) { | 132 if (create_params.state == ui::SHOW_STATE_DOCKED) { |
| 132 widget()->GetNativeWindow()->SetProperty(aura::client::kShowStateKey, | 133 widget()->GetNativeWindow()->SetProperty(aura::client::kShowStateKey, |
| 133 create_params.state); | 134 create_params.state); |
| 134 } | 135 } |
| 136 widget()->GetNativeWindow()->SetProperty( | |
| 137 chromeos::kStylusWindowTypeBucket, | |
| 138 chromeos::StylusWindowType::WINDOW_TYPE_APP); | |
|
sky
2016/09/16 23:20:17
This is also used for panels, are you sure you wan
xiaoyinh(OOO Sep 11-29)
2016/09/19 21:19:53
Thanks for pointing this out. I've move it to Chro
| |
| 135 } | 139 } |
| 136 | 140 |
| 137 void ChromeNativeAppWindowViewsAuraAsh::OnBeforeWidgetInit( | 141 void ChromeNativeAppWindowViewsAuraAsh::OnBeforeWidgetInit( |
| 138 const AppWindow::CreateParams& create_params, | 142 const AppWindow::CreateParams& create_params, |
| 139 views::Widget::InitParams* init_params, | 143 views::Widget::InitParams* init_params, |
| 140 views::Widget* widget) { | 144 views::Widget* widget) { |
| 141 ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit(create_params, init_params, | 145 ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit(create_params, init_params, |
| 142 widget); | 146 widget); |
| 143 if (create_params.is_ime_window) { | 147 if (create_params.is_ime_window) { |
| 144 // Puts ime windows into ime window container. | 148 // Puts ime windows into ime window container. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 349 GetMusWindow(widget()->GetNativeWindow()) | 353 GetMusWindow(widget()->GetNativeWindow()) |
| 350 ->SetClientArea(insets, std::move(additional_client_regions)); | 354 ->SetClientArea(insets, std::move(additional_client_regions)); |
| 351 } | 355 } |
| 352 } | 356 } |
| 353 | 357 |
| 354 void ChromeNativeAppWindowViewsAuraAsh::OnMenuClosed() { | 358 void ChromeNativeAppWindowViewsAuraAsh::OnMenuClosed() { |
| 355 menu_runner_.reset(); | 359 menu_runner_.reset(); |
| 356 menu_model_adapter_.reset(); | 360 menu_model_adapter_.reset(); |
| 357 menu_model_.reset(); | 361 menu_model_.reset(); |
| 358 } | 362 } |
| OLD | NEW |