Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/window_resizer.h" | 9 #include "ash/common/wm/window_resizer.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 #include "ui/base/accelerators/accelerator.h" | 29 #include "ui/base/accelerators/accelerator.h" |
| 30 #include "ui/gfx/path.h" | 30 #include "ui/gfx/path.h" |
| 31 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
| 32 #include "ui/views/widget/widget_observer.h" | 32 #include "ui/views/widget/widget_observer.h" |
| 33 #include "ui/wm/core/coordinate_conversion.h" | 33 #include "ui/wm/core/coordinate_conversion.h" |
| 34 #include "ui/wm/core/shadow.h" | 34 #include "ui/wm/core/shadow.h" |
| 35 #include "ui/wm/core/shadow_controller.h" | 35 #include "ui/wm/core/shadow_controller.h" |
| 36 #include "ui/wm/core/shadow_types.h" | 36 #include "ui/wm/core/shadow_types.h" |
| 37 #include "ui/wm/core/window_util.h" | 37 #include "ui/wm/core/window_util.h" |
| 38 | 38 |
| 39 #if defined(OS_CHROMEOS) | |
| 40 #include "ash/shared/app_types.h" | |
| 41 #endif | |
| 42 | |
| 39 DECLARE_WINDOW_PROPERTY_TYPE(std::string*) | 43 DECLARE_WINDOW_PROPERTY_TYPE(std::string*) |
| 40 | 44 |
| 41 namespace exo { | 45 namespace exo { |
| 42 namespace { | 46 namespace { |
| 43 | 47 |
| 44 // This is a struct for accelerator keys used to close ShellSurfaces. | 48 // This is a struct for accelerator keys used to close ShellSurfaces. |
| 45 const struct Accelerator { | 49 const struct Accelerator { |
| 46 ui::KeyboardCode keycode; | 50 ui::KeyboardCode keycode; |
| 47 int modifiers; | 51 int modifiers; |
| 48 } kCloseWindowAccelerators[] = { | 52 } kCloseWindowAccelerators[] = { |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 933 widget_ = new ShellSurfaceWidget(this); | 937 widget_ = new ShellSurfaceWidget(this); |
| 934 widget_->Init(params); | 938 widget_->Init(params); |
| 935 | 939 |
| 936 aura::Window* window = widget_->GetNativeWindow(); | 940 aura::Window* window = widget_->GetNativeWindow(); |
| 937 window->SetName("ExoShellSurface"); | 941 window->SetName("ExoShellSurface"); |
| 938 window->AddChild(surface_->window()); | 942 window->AddChild(surface_->window()); |
| 939 window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); | 943 window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); |
| 940 SetApplicationId(window, &application_id_); | 944 SetApplicationId(window, &application_id_); |
| 941 SetMainSurface(window, surface_); | 945 SetMainSurface(window, surface_); |
| 942 | 946 |
| 947 #if defined(OS_CHROMEOS) | |
| 948 window->SetProperty(aura::client::kAppType, | |
| 949 static_cast<int>(ash::AppType::ARC_APP)); | |
|
reveman
2016/09/27 20:39:00
This is incorrect. All shell surfaces are not arc
xiaoyinh(OOO Sep 11-29)
2016/09/29 20:37:44
Thanks for pointing it out. I have moved it to arc
| |
| 950 #endif | |
| 951 | |
| 943 // Start tracking changes to window bounds and window state. | 952 // Start tracking changes to window bounds and window state. |
| 944 window->AddObserver(this); | 953 window->AddObserver(this); |
| 945 ash::wm::WindowState* window_state = ash::wm::GetWindowState(window); | 954 ash::wm::WindowState* window_state = ash::wm::GetWindowState(window); |
| 946 window_state->AddObserver(this); | 955 window_state->AddObserver(this); |
| 947 | 956 |
| 948 // Absolete positioned shell surfaces may request the bounds that does not | 957 // Absolete positioned shell surfaces may request the bounds that does not |
| 949 // fill the entire work area / display in maximized / fullscreen state. | 958 // fill the entire work area / display in maximized / fullscreen state. |
| 950 // Allow such clients to update the bounds in these states. | 959 // Allow such clients to update the bounds in these states. |
| 951 if (!initial_bounds_.IsEmpty()) | 960 if (!initial_bounds_.IsEmpty()) |
| 952 window_state->set_allow_set_bounds_in_maximized(true); | 961 window_state->set_allow_set_bounds_in_maximized(true); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1295 shadow_overlay_->layer()->Add(shadow->layer()); | 1304 shadow_overlay_->layer()->Add(shadow->layer()); |
| 1296 window->AddChild(shadow_overlay_); | 1305 window->AddChild(shadow_overlay_); |
| 1297 shadow_overlay_->Show(); | 1306 shadow_overlay_->Show(); |
| 1298 } | 1307 } |
| 1299 shadow_overlay_->SetBounds(shadow_bounds); | 1308 shadow_overlay_->SetBounds(shadow_bounds); |
| 1300 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1309 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1301 } | 1310 } |
| 1302 } | 1311 } |
| 1303 | 1312 |
| 1304 } // namespace exo | 1313 } // namespace exo |
| OLD | NEW |