Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc

Issue 2184103003: arc: Implement proper Arc window activation for task moving to front. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // TODO(reveman): Figure out how to support fullscreen in interleaved 456 // TODO(reveman): Figure out how to support fullscreen in interleaved
457 // window mode. 457 // window mode.
458 // if (new_active_app_it->second->widget()) { 458 // if (new_active_app_it->second->widget()) {
459 // new_active_app_it->second->widget()->SetFullscreen( 459 // new_active_app_it->second->widget()->SetFullscreen(
460 // new_active_app_it->second->fullscreen_mode() == 460 // new_active_app_it->second->fullscreen_mode() ==
461 // FullScreenMode::ACTIVE); 461 // FullScreenMode::ACTIVE);
462 // } 462 // }
463 } 463 }
464 } 464 }
465 465
466 void ArcAppWindowLauncherController::OnTaskMovedToFront(int32_t task_id) {
467 TaskIdToAppWindow::const_iterator app_it =
468 task_id_to_app_window_.find(task_id);
469 if (app_it == task_id_to_app_window_.end())
470 return;
471 if (app_it->second->IsActive())
472 return;
473 app_it->second->Activate();
474 }
475
466 void ArcAppWindowLauncherController::OnTaskOrientationLockRequested( 476 void ArcAppWindowLauncherController::OnTaskOrientationLockRequested(
467 int32_t task_id, 477 int32_t task_id,
468 const arc::mojom::OrientationLock orientation_lock) { 478 const arc::mojom::OrientationLock orientation_lock) {
469 // Don't save to AppInfo because this is requested in runtime. 479 // Don't save to AppInfo because this is requested in runtime.
470 TaskIdToAppWindow::iterator app_it = task_id_to_app_window_.find(task_id); 480 TaskIdToAppWindow::iterator app_it = task_id_to_app_window_.find(task_id);
471 if (app_it == task_id_to_app_window_.end()) 481 if (app_it == task_id_to_app_window_.end())
472 return; 482 return;
473 AppWindow* app_window = app_it->second.get(); 483 AppWindow* app_window = app_it->second.get();
474 app_window->set_requested_orientation_lock(orientation_lock); 484 app_window->set_requested_orientation_lock(orientation_lock);
475 485
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { 610 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) {
601 // Resolve the orientation when it first resolved. 611 // Resolve the orientation when it first resolved.
602 orientation_lock = GetCurrentOrientation(); 612 orientation_lock = GetCurrentOrientation();
603 app_window->set_requested_orientation_lock(orientation_lock); 613 app_window->set_requested_orientation_lock(orientation_lock);
604 } 614 }
605 615
606 ash::Shell* shell = ash::Shell::GetInstance(); 616 ash::Shell* shell = ash::Shell::GetInstance();
607 shell->screen_orientation_controller()->LockOrientationForWindow( 617 shell->screen_orientation_controller()->LockOrientationForWindow(
608 window, BlinkOrientationLockFromMojom(orientation_lock)); 618 window, BlinkOrientationLockFromMojom(orientation_lock));
609 } 619 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698