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