| 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/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 11 #include "ash/common/wm/window_state.h" | 11 #include "ash/common/wm/window_state.h" |
| 12 #include "ash/common/wm_lookup.h" | 12 #include "ash/common/wm_lookup.h" |
| 13 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 14 #include "ash/common/wm_window_property.h" | 14 #include "ash/common/wm_window_property.h" |
| 15 #include "ash/display/display_manager.h" | 15 #include "ash/display/display_manager.h" |
| 16 #include "ash/display/screen_orientation_controller_chromeos.h" | 16 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 17 #include "ash/shared/app_types.h" |
| 17 #include "ash/shell.h" | 18 #include "ash/shell.h" |
| 18 #include "ash/wm/window_state_aura.h" | 19 #include "ash/wm/window_state_aura.h" |
| 19 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
| 20 #include "base/bind.h" | 21 #include "base/bind.h" |
| 21 #include "chrome/browser/chromeos/arc/arc_auth_service.h" | 22 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 22 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 23 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 25 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 25 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" | 26 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" |
| 26 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 27 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // the layout switch information. | 379 // the layout switch information. |
| 379 if (!observing_shell_) { | 380 if (!observing_shell_) { |
| 380 observing_shell_ = true; | 381 observing_shell_ = true; |
| 381 ash::WmShell::Get()->AddShellObserver(this); | 382 ash::WmShell::Get()->AddShellObserver(this); |
| 382 } | 383 } |
| 383 | 384 |
| 384 // Check if we have controller for this task. | 385 // Check if we have controller for this task. |
| 385 if (GetAppWindowForTask(task_id)) | 386 if (GetAppWindowForTask(task_id)) |
| 386 return; | 387 return; |
| 387 | 388 |
| 389 window->SetProperty(aura::client::kAppType, |
| 390 static_cast<int>(ash::AppType::ARC_APP)); |
| 391 |
| 388 // Create controller if we have task info. | 392 // Create controller if we have task info. |
| 389 TaskIdToShelfAppIdMap::iterator it = task_id_to_shelf_app_id_.find(task_id); | 393 TaskIdToShelfAppIdMap::iterator it = task_id_to_shelf_app_id_.find(task_id); |
| 390 if (it == task_id_to_shelf_app_id_.end()) | 394 if (it == task_id_to_shelf_app_id_.end()) |
| 391 return; | 395 return; |
| 392 | 396 |
| 393 const std::string& app_id = it->second; | 397 const std::string& app_id = it->second; |
| 394 | 398 |
| 395 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); | 399 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); |
| 396 DCHECK(widget); | 400 DCHECK(widget); |
| 397 std::unique_ptr<AppWindow> app_window( | 401 std::unique_ptr<AppWindow> app_window( |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { | 682 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { |
| 679 // Resolve the orientation when it first resolved. | 683 // Resolve the orientation when it first resolved. |
| 680 orientation_lock = GetCurrentOrientation(); | 684 orientation_lock = GetCurrentOrientation(); |
| 681 app_window->set_requested_orientation_lock(orientation_lock); | 685 app_window->set_requested_orientation_lock(orientation_lock); |
| 682 } | 686 } |
| 683 | 687 |
| 684 ash::Shell* shell = ash::Shell::GetInstance(); | 688 ash::Shell* shell = ash::Shell::GetInstance(); |
| 685 shell->screen_orientation_controller()->LockOrientationForWindow( | 689 shell->screen_orientation_controller()->LockOrientationForWindow( |
| 686 window, BlinkOrientationLockFromMojom(orientation_lock)); | 690 window, BlinkOrientationLockFromMojom(orientation_lock)); |
| 687 } | 691 } |
| OLD | NEW |