| 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 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 4 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "ash/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 9 #include "ash/public/cpp/window_properties.h" | 9 #include "ash/public/cpp/window_properties.h" |
| 10 #include "ash/shared/app_types.h" | 10 #include "ash/shared/app_types.h" |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 671 |
| 672 ArcAppWindowLauncherItemController* controller = app_window->controller(); | 672 ArcAppWindowLauncherItemController* controller = app_window->controller(); |
| 673 if (controller) | 673 if (controller) |
| 674 controller->RemoveWindow(app_window); | 674 controller->RemoveWindow(app_window); |
| 675 app_window->ResetController(); | 675 app_window->ResetController(); |
| 676 app_window_info->set_app_window(nullptr); | 676 app_window_info->set_app_window(nullptr); |
| 677 } | 677 } |
| 678 | 678 |
| 679 void ArcAppWindowLauncherController::SetOrientationLockForAppWindow( | 679 void ArcAppWindowLauncherController::SetOrientationLockForAppWindow( |
| 680 AppWindow* app_window) { | 680 AppWindow* app_window) { |
| 681 ash::WmWindow* window = | 681 aura::Window* window = app_window->widget()->GetNativeWindow(); |
| 682 ash::WmWindow::Get(app_window->widget()->GetNativeWindow()); | |
| 683 if (!window) | 682 if (!window) |
| 684 return; | 683 return; |
| 685 AppWindowInfo* info = GetAppWindowInfoForTask(app_window->task_id()); | 684 AppWindowInfo* info = GetAppWindowInfoForTask(app_window->task_id()); |
| 686 arc::mojom::OrientationLock orientation_lock; | 685 arc::mojom::OrientationLock orientation_lock; |
| 687 | 686 |
| 688 ScreenOrientationController::LockCompletionBehavior lock_completion_behavior = | 687 ScreenOrientationController::LockCompletionBehavior lock_completion_behavior = |
| 689 ScreenOrientationController::LockCompletionBehavior::None; | 688 ScreenOrientationController::LockCompletionBehavior::None; |
| 690 if (info->has_requested_orientation_lock()) { | 689 if (info->has_requested_orientation_lock()) { |
| 691 orientation_lock = info->requested_orientation_lock(); | 690 orientation_lock = info->requested_orientation_lock(); |
| 692 lock_completion_behavior = info->lock_completion_behavior(); | 691 lock_completion_behavior = info->lock_completion_behavior(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 714 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); | 713 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); |
| 715 if (arc_app_id.empty()) | 714 if (arc_app_id.empty()) |
| 716 return -1; | 715 return -1; |
| 717 | 716 |
| 718 int task_id = -1; | 717 int task_id = -1; |
| 719 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) | 718 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) |
| 720 return -1; | 719 return -1; |
| 721 | 720 |
| 722 return task_id; | 721 return task_id; |
| 723 } | 722 } |
| OLD | NEW |