| 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" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 569 |
| 570 ArcAppWindowLauncherItemController* controller; | 570 ArcAppWindowLauncherItemController* controller; |
| 571 AppControllerMap::iterator it = app_controller_map_.find(app_id); | 571 AppControllerMap::iterator it = app_controller_map_.find(app_id); |
| 572 ash::ShelfID shelf_id = 0; | 572 ash::ShelfID shelf_id = 0; |
| 573 if (it != app_controller_map_.end()) { | 573 if (it != app_controller_map_.end()) { |
| 574 controller = it->second; | 574 controller = it->second; |
| 575 DCHECK_EQ(controller->app_id(), app_id); | 575 DCHECK_EQ(controller->app_id(), app_id); |
| 576 shelf_id = controller->shelf_id(); | 576 shelf_id = controller->shelf_id(); |
| 577 } else { | 577 } else { |
| 578 controller = new ArcAppWindowLauncherItemController(app_id, owner()); | 578 controller = new ArcAppWindowLauncherItemController(app_id, owner()); |
| 579 shelf_id = shelf_delegate_->GetShelfIDForAppID(app_id); | 579 shelf_id = shelf_delegate_->GetShelfIDForAppID(app_id, app_id); |
| 580 if (shelf_id == 0) { | 580 if (shelf_id == 0) { |
| 581 // Map Play Store shelf icon to Arc Support host, to share one entry. | 581 // Map Play Store shelf icon to Arc Support host, to share one entry. |
| 582 shelf_id = owner()->CreateAppLauncherItem(controller, app_id, | 582 shelf_id = owner()->CreateAppLauncherItem(controller, app_id, |
| 583 ash::STATUS_RUNNING); | 583 ash::STATUS_RUNNING); |
| 584 } else { | 584 } else { |
| 585 owner()->SetItemController(shelf_id, controller); | 585 owner()->SetItemController(shelf_id, controller); |
| 586 } | 586 } |
| 587 app_controller_map_[app_id] = controller; | 587 app_controller_map_[app_id] = controller; |
| 588 } | 588 } |
| 589 controller->AddWindow(app_window); | 589 controller->AddWindow(app_window); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { | 629 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { |
| 630 // Resolve the orientation when it first resolved. | 630 // Resolve the orientation when it first resolved. |
| 631 orientation_lock = GetCurrentOrientation(); | 631 orientation_lock = GetCurrentOrientation(); |
| 632 app_window->set_requested_orientation_lock(orientation_lock); | 632 app_window->set_requested_orientation_lock(orientation_lock); |
| 633 } | 633 } |
| 634 | 634 |
| 635 ash::Shell* shell = ash::Shell::GetInstance(); | 635 ash::Shell* shell = ash::Shell::GetInstance(); |
| 636 shell->screen_orientation_controller()->LockOrientationForWindow( | 636 shell->screen_orientation_controller()->LockOrientationForWindow( |
| 637 window, BlinkOrientationLockFromMojom(orientation_lock)); | 637 window, BlinkOrientationLockFromMojom(orientation_lock)); |
| 638 } | 638 } |
| OLD | NEW |