| 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> |
| 7 |
| 6 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 7 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 8 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| 9 #include "ash/display/screen_orientation_controller_chromeos.h" | 11 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 10 #include "ash/shelf/shelf_delegate.h" | 12 #include "ash/shelf/shelf_delegate.h" |
| 11 #include "ash/shelf/shelf_util.h" | 13 #include "ash/shelf/shelf_util.h" |
| 12 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 15 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 14 #include "ash/wm/window_state_aura.h" | 16 #include "ash/wm/window_state_aura.h" |
| 15 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 206 } |
| 205 | 207 |
| 206 bool has_requested_orientation_lock() const { | 208 bool has_requested_orientation_lock() const { |
| 207 return has_requested_orientation_lock_; | 209 return has_requested_orientation_lock_; |
| 208 } | 210 } |
| 209 | 211 |
| 210 private: | 212 private: |
| 211 arc::mojom::AppInstance* GetAppInstance() { | 213 arc::mojom::AppInstance* GetAppInstance() { |
| 212 arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); | 214 arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); |
| 213 arc::mojom::AppInstance* app_instance = | 215 arc::mojom::AppInstance* app_instance = |
| 214 bridge_service ? bridge_service->app_instance() : nullptr; | 216 bridge_service ? bridge_service->app()->instance() : nullptr; |
| 215 if (!app_instance) { | 217 if (!app_instance) { |
| 216 VLOG(2) << "Arc Bridge is not available."; | 218 VLOG(2) << "Arc Bridge is not available."; |
| 217 return nullptr; | 219 return nullptr; |
| 218 } | 220 } |
| 219 | 221 |
| 220 if (bridge_service->app_version() < 3) { | 222 if (bridge_service->app()->version() < 3) { |
| 221 VLOG(2) << "Arc Bridge has old version for apps." | 223 VLOG(2) << "Arc Bridge has old version for apps." |
| 222 << bridge_service->app_version(); | 224 << bridge_service->app()->version(); |
| 223 return nullptr; | 225 return nullptr; |
| 224 } | 226 } |
| 225 return app_instance; | 227 return app_instance; |
| 226 } | 228 } |
| 227 | 229 |
| 228 int task_id_; | 230 int task_id_; |
| 229 ash::ShelfID shelf_id_ = 0; | 231 ash::ShelfID shelf_id_ = 0; |
| 230 std::string app_id_; | 232 std::string app_id_; |
| 231 FullScreenMode fullscreen_mode_ = FullScreenMode::NOT_DEFINED; | 233 FullScreenMode fullscreen_mode_ = FullScreenMode::NOT_DEFINED; |
| 232 // Unowned pointers | 234 // Unowned pointers |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 600 |
| 599 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { | 601 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { |
| 600 // Resolve the orientation when it first resolved. | 602 // Resolve the orientation when it first resolved. |
| 601 orientation_lock = GetCurrentOrientation(); | 603 orientation_lock = GetCurrentOrientation(); |
| 602 app_window->set_requested_orientation_lock(orientation_lock); | 604 app_window->set_requested_orientation_lock(orientation_lock); |
| 603 } | 605 } |
| 604 | 606 |
| 605 shell->screen_orientation_controller()->LockOrientationForWindow( | 607 shell->screen_orientation_controller()->LockOrientationForWindow( |
| 606 window, BlinkOrientationLockFromMojom(orientation_lock)); | 608 window, BlinkOrientationLockFromMojom(orientation_lock)); |
| 607 } | 609 } |
| OLD | NEW |