| 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/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 9 #include "ash/shared/app_types.h" | 9 #include "ash/shared/app_types.h" |
| 10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 12 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 13 #include "ash/wm/window_properties.h" | 13 #include "ash/wm/window_properties.h" |
| 14 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
| 15 #include "ash/wm/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 16 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 17 #include "ash/wm_window.h" | 17 #include "ash/wm_window.h" |
| 18 #include "base/bind.h" | 18 #include "base/bind.h" |
| 19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 20 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 20 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 21 #include "chrome/browser/chromeos/arc/arc_util.h" | 21 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 23 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 24 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" | 24 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" |
| 25 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 25 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 26 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 26 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 27 #include "components/arc/arc_bridge_service.h" | 27 #include "components/arc/arc_bridge_service.h" |
| 28 #include "components/exo/shell_surface.h" | 28 #include "components/exo/shell_surface.h" |
| 29 #include "components/signin/core/account_id/account_id.h" | 29 #include "components/signin/core/account_id/account_id.h" |
| 30 #include "components/user_manager/user_manager.h" | 30 #include "components/user_manager/user_manager.h" |
| 31 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 31 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
| 32 #include "ui/aura/client/aura_constants.h" | 32 #include "ui/aura/client/aura_constants.h" |
| 33 #include "ui/aura/env.h" | 33 #include "ui/aura/env.h" |
| 34 #include "ui/base/base_window.h" | 34 #include "ui/base/base_window.h" |
| 35 #include "ui/display/display.h" | 35 #include "ui/display/display.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // Unowned pointers | 241 // Unowned pointers |
| 242 views::Widget* const widget_; | 242 views::Widget* const widget_; |
| 243 ArcAppWindowLauncherController* owner_; | 243 ArcAppWindowLauncherController* owner_; |
| 244 ArcAppWindowLauncherItemController* controller_ = nullptr; | 244 ArcAppWindowLauncherItemController* controller_ = nullptr; |
| 245 // Unowned pointer, represents host ARC window. | 245 // Unowned pointer, represents host ARC window. |
| 246 | 246 |
| 247 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 247 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 ArcAppWindowLauncherController::ArcAppWindowLauncherController( | 250 ArcAppWindowLauncherController::ArcAppWindowLauncherController( |
| 251 ChromeLauncherController* owner) | 251 ChromeLauncherControllerImpl* owner) |
| 252 : AppWindowLauncherController(owner) { | 252 : AppWindowLauncherController(owner) { |
| 253 if (arc::IsArcAllowedForProfile(owner->profile())) { | 253 if (arc::IsArcAllowedForProfile(owner->profile())) { |
| 254 observed_profile_ = owner->profile(); | 254 observed_profile_ = owner->profile(); |
| 255 StartObserving(observed_profile_); | 255 StartObserving(observed_profile_); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 ArcAppWindowLauncherController::~ArcAppWindowLauncherController() { | 259 ArcAppWindowLauncherController::~ArcAppWindowLauncherController() { |
| 260 if (observed_profile_) | 260 if (observed_profile_) |
| 261 StopObserving(observed_profile_); | 261 StopObserving(observed_profile_); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); | 736 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); |
| 737 if (arc_app_id.empty()) | 737 if (arc_app_id.empty()) |
| 738 return -1; | 738 return -1; |
| 739 | 739 |
| 740 int task_id = -1; | 740 int task_id = -1; |
| 741 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) | 741 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) |
| 742 return -1; | 742 return -1; |
| 743 | 743 |
| 744 return task_id; | 744 return task_id; |
| 745 } | 745 } |
| OLD | NEW |