| 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_shell.h" | 10 #include "ash/common/wm_shell.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/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 14 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 15 #include "base/bind.h" | 17 #include "base/bind.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 183 } |
| 182 | 184 |
| 183 bool has_requested_orientation_lock() const { | 185 bool has_requested_orientation_lock() const { |
| 184 return has_requested_orientation_lock_; | 186 return has_requested_orientation_lock_; |
| 185 } | 187 } |
| 186 | 188 |
| 187 private: | 189 private: |
| 188 arc::mojom::AppInstance* GetAppInstance() { | 190 arc::mojom::AppInstance* GetAppInstance() { |
| 189 arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); | 191 arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); |
| 190 arc::mojom::AppInstance* app_instance = | 192 arc::mojom::AppInstance* app_instance = |
| 191 bridge_service ? bridge_service->app_instance() : nullptr; | 193 bridge_service ? bridge_service->app()->instance() : nullptr; |
| 192 if (!app_instance) { | 194 if (!app_instance) { |
| 193 VLOG(2) << "Arc Bridge is not available."; | 195 VLOG(2) << "Arc Bridge is not available."; |
| 194 return nullptr; | 196 return nullptr; |
| 195 } | 197 } |
| 196 | 198 |
| 197 if (bridge_service->app_version() < 3) { | 199 if (bridge_service->app()->version() < 3) { |
| 198 VLOG(2) << "Arc Bridge has old version for apps." | 200 VLOG(2) << "Arc Bridge has old version for apps." |
| 199 << bridge_service->app_version(); | 201 << bridge_service->app()->version(); |
| 200 return nullptr; | 202 return nullptr; |
| 201 } | 203 } |
| 202 return app_instance; | 204 return app_instance; |
| 203 } | 205 } |
| 204 | 206 |
| 205 int task_id_; | 207 int task_id_; |
| 206 ash::ShelfID shelf_id_ = 0; | 208 ash::ShelfID shelf_id_ = 0; |
| 207 std::string app_id_; | 209 std::string app_id_; |
| 208 FullScreenMode fullscreen_mode_ = FullScreenMode::NOT_DEFINED; | 210 FullScreenMode fullscreen_mode_ = FullScreenMode::NOT_DEFINED; |
| 209 // Unowned pointers | 211 // Unowned pointers |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(observed_profile_); | 570 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(observed_profile_); |
| 569 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = | 571 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = |
| 570 prefs->GetApp(app_window->app_id()); | 572 prefs->GetApp(app_window->app_id()); |
| 571 if (!app_info) | 573 if (!app_info) |
| 572 return; | 574 return; |
| 573 orientation_lock = app_info->orientation_lock; | 575 orientation_lock = app_info->orientation_lock; |
| 574 } | 576 } |
| 575 shell->screen_orientation_controller()->LockOrientationForWindow( | 577 shell->screen_orientation_controller()->LockOrientationForWindow( |
| 576 window, BlinkOrientationLockFromMojom(orientation_lock)); | 578 window, BlinkOrientationLockFromMojom(orientation_lock)); |
| 577 } | 579 } |
| OLD | NEW |