| 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/common/shelf/shelf_delegate.h" | 8 #include "ash/common/shelf/shelf_delegate.h" |
| 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| 11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 13 #include "ash/common/wm_window_property.h" | |
| 14 #include "ash/display/screen_orientation_controller_chromeos.h" | 13 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 15 #include "ash/shared/app_types.h" | 14 #include "ash/shared/app_types.h" |
| 16 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 16 #include "ash/wm/window_properties.h" |
| 17 #include "ash/wm/window_state_aura.h" | 17 #include "ash/wm/window_state_aura.h" |
| 18 #include "ash/wm/window_util.h" | 18 #include "ash/wm/window_util.h" |
| 19 #include "base/bind.h" | 19 #include "base/bind.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 21 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 22 #include "chrome/browser/chromeos/arc/arc_util.h" | 22 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 24 #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" | 25 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" |
| 26 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 26 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return; | 415 return; |
| 416 } | 416 } |
| 417 | 417 |
| 418 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); | 418 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); |
| 419 DCHECK(widget); | 419 DCHECK(widget); |
| 420 DCHECK(!info->app_window()); | 420 DCHECK(!info->app_window()); |
| 421 info->set_app_window( | 421 info->set_app_window( |
| 422 base::MakeUnique<AppWindow>(task_id, info->app_shelf_id(), widget, this)); | 422 base::MakeUnique<AppWindow>(task_id, info->app_shelf_id(), widget, this)); |
| 423 RegisterApp(info); | 423 RegisterApp(info); |
| 424 DCHECK(info->app_window()->controller()); | 424 DCHECK(info->app_window()->controller()); |
| 425 ash::WmWindow::Get(window)->SetIntProperty(ash::WmWindowProperty::SHELF_ID, | 425 window->SetProperty(ash::kShelfIDKey, info->app_window()->shelf_id()); |
| 426 info->app_window()->shelf_id()); | |
| 427 if (ash::WmShell::Get() | 426 if (ash::WmShell::Get() |
| 428 ->maximize_mode_controller() | 427 ->maximize_mode_controller() |
| 429 ->IsMaximizeModeWindowManagerEnabled()) { | 428 ->IsMaximizeModeWindowManagerEnabled()) { |
| 430 SetOrientationLockForAppWindow(info->app_window()); | 429 SetOrientationLockForAppWindow(info->app_window()); |
| 431 } | 430 } |
| 432 } | 431 } |
| 433 | 432 |
| 434 void ArcAppWindowLauncherController::OnAppReadyChanged( | 433 void ArcAppWindowLauncherController::OnAppReadyChanged( |
| 435 const std::string& arc_app_id, | 434 const std::string& arc_app_id, |
| 436 bool ready) { | 435 bool ready) { |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); | 718 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); |
| 720 if (arc_app_id.empty()) | 719 if (arc_app_id.empty()) |
| 721 return -1; | 720 return -1; |
| 722 | 721 |
| 723 int task_id = -1; | 722 int task_id = -1; |
| 724 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) | 723 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) |
| 725 return -1; | 724 return -1; |
| 726 | 725 |
| 727 return task_id; | 726 return task_id; |
| 728 } | 727 } |
| OLD | NEW |